* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-title {
    text-align: left;
}

.header-title h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.date-display {
    font-size: 1.2rem;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    color: #4facfe;
    border-bottom-color: #4facfe;
    background: white;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

/* Daily Summary */
.daily-summary {
    margin-bottom: 30px;
}

.daily-summary h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.progress-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.progress-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.progress-card h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-card p {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Meals Section */
.meals-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.meal-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.meal-card:hover {
    border-color: #4facfe;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.15);
}

.meal-card h3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 15px 20px;
    margin: 0;
    font-size: 1.3rem;
}

.meal-items {
    padding: 20px;
}

.meal-items label {
    display: block;
    margin-bottom: 12px;
    font-size: 1rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.meal-items label:hover {
    background: #f8f9fa;
}

.meal-items input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
    accent-color: #4facfe;
}

.meal-items input[type="checkbox"]:checked + * {
    color: #28a745;
    font-weight: 600;
}

/* Supplement sections within meals */
.supplements-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #f1f3f4;
}

.supplements-section h4 {
    color: #dc3545;
    margin-bottom: 12px;
    font-size: 1rem;
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
}

.supplements-section .meal-items label {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.supplements-section .meal-items label:hover {
    background: #ffeaa7;
}

/* Action Buttons */
.action-buttons, .supplement-actions, .cycle-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.save-btn, .reset-btn, .clear-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.save-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.save-btn:active {
    transform: translateY(0px);
    transition: transform 0.1s ease;
}

.save-btn.saving {
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%);
    cursor: wait;
    transform: scale(0.98);
}

.save-btn.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    }
}

.reset-btn, .clear-btn {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.reset-btn:hover, .clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
}

/* History Section */
.history-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.history-filters select {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.history-filters select:focus {
    outline: none;
    border-color: #4facfe;
}

.history-list {
    max-height: 600px;
    overflow-y: auto;
}

.history-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.history-item h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-macros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.history-macro {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.history-macro .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4facfe;
}

.history-macro .label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 5px;
}

.history-meals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.history-meal {
    background: #e9ecef;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.delete-history {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.delete-history:hover {
    background: #c82333;
}

/* Plan Section */
.plan-overview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.plan-macros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.macro-item {
    text-align: center;
    font-size: 1.1rem;
}

.plan-meals {
    display: grid;
    gap: 20px;
}

.plan-meal {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.plan-meal h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 2px solid #4facfe;
    padding-bottom: 10px;
}

.plan-meal ul {
    list-style: none;
}

.plan-meal li {
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
    font-size: 1rem;
}

.plan-meal li:before {
    content: "✓ ";
    color: #28a745;
    font-weight: bold;
    margin-right: 8px;
}

.plan-meal li:last-child {
    border-bottom: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-title {
        text-align: center;
    }
    
    .logout-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .tab-nav {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .tab-btn {
        flex: 1 1 calc(50% - 2.5px);
        min-width: 120px;
        padding: 12px 15px;
        font-size: 0.9rem;
        border-bottom: none;
        border-right: 3px solid transparent;
    }
    
    .tab-btn.active {
        border-right-color: #4facfe;
        border-bottom-color: transparent;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .progress-cards {
        grid-template-columns: 1fr;
    }
    
    .action-buttons, .supplement-actions, .cycle-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .save-btn, .reset-btn, .clear-btn {
        margin: 5px 0;
        width: 100%;
    }
    
    .history-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .history-macros {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .plan-macros {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .date-display {
        font-size: 1rem;
    }
    
    .tab-nav {
        flex-direction: column;
        gap: 2px;
    }
    
    .tab-btn {
        flex: 1;
        min-width: auto;
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .meal-card h3 {
        font-size: 1.1rem;
        padding: 12px 15px;
    }
    
    .meal-items {
        padding: 15px;
    }
    
    .meal-items label {
        font-size: 0.9rem;
        padding: 8px;
    }
    
    .history-macros {
        grid-template-columns: 1fr;
    }
    
    .plan-macros {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Cycle Planning Styles */
.cycle-warning {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
}

.cycle-weeks {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .cycle-weeks {
        gap: 15px;
        margin-bottom: 20px;
    }
}

.week-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.week-card:hover {
    border-color: #dc3545;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.15);
}

.week-card h3 {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    padding: 15px 20px;
    margin: 0;
    font-size: 1.3rem;
    text-align: center;
}

.cycle-day {
    padding: 20px;
    border-bottom: 1px solid #f1f3f4;
}

.cycle-day:last-child {
    border-bottom: none;
}

.cycle-day h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #4facfe;
}

.cycle-items {
    display: grid;
    gap: 10px;
}

.cycle-items label {
    display: block;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.cycle-items label:hover {
    background: #e9ecef;
}

/* Kür planlaması için checkbox stilleri */
.cycle-items input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
    accent-color: #dc3545;
}

/* İşaretli checkbox'lar için üstü çizili stil */
.cycle-items label:has(input[type="checkbox"]:checked) {
    color: #dc3545 !important;
    font-weight: 600 !important;
    text-decoration: line-through !important;
    background: #ffe6e6 !important;
}

/* Modern tarayıcılar için alternatif */
.cycle-items input[type="checkbox"]:checked + span,
.cycle-items input[type="checkbox"]:checked ~ * {
    color: #dc3545;
    font-weight: 600;
    text-decoration: line-through;
}

/* Fallback için JavaScript ile çalışacak class */
.cycle-items label.checked-item {
    color: #dc3545 !important;
    font-weight: 600 !important;
    text-decoration: line-through !important;
    background: #ffe6e6 !important;
}

.additional-meds, .daily-supplements {
    margin: 30px 0;
}

.additional-meds h3, .daily-supplements h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

.med-card, .supplement-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.med-card h4, .supplement-card h4 {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 12px 20px;
    margin: 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #dee2e6;
}

.med-card .cycle-items, .supplement-card .cycle-items {
    padding: 20px;
}

.cycle-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

/* Responsive adjustments for cycle planning */
@media (max-width: 768px) {
    .cycle-day {
        padding: 15px;
    }
    
    .cycle-items {
        gap: 8px;
    }
    
    .cycle-items label {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .week-card h3 {
        font-size: 1.1rem;
        padding: 12px 15px;
    }
    
    .cycle-day h4 {
        font-size: 1rem;
    }
    
    .cycle-warning {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .cycle-weeks {
        gap: 15px;
    }
    
    .additional-meds h3, .daily-supplements h3 {
        font-size: 1.2rem;
        padding: 12px;
    }
    
    .med-card h4, .supplement-card h4 {
        font-size: 1rem;
        padding: 10px 15px;
    }
    
    .med-card .cycle-items, .supplement-card .cycle-items {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .cycle-warning {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .week-card h3 {
        font-size: 1rem;
        padding: 10px 12px;
    }
    
    .cycle-day {
        padding: 12px;
    }
    
    .cycle-day h4 {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .cycle-items label {
        padding: 8px;
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .additional-meds h3, .daily-supplements h3 {
        font-size: 1.1rem;
        padding: 10px;
    }
    
    .med-card h4, .supplement-card h4 {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .med-card .cycle-items, .supplement-card .cycle-items {
        padding: 12px;
    }
    
    .cycle-actions {
        padding-top: 20px;
        margin-top: 20px;
    }
    
    .save-btn, .reset-btn {
        width: 100%;
        margin: 5px 0;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

/* Supplement Section Styles */
.supplement-progress {
    margin-bottom: 30px;
}

.supplement-progress .progress-card {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    text-align: center;
}

.special-meds {
    border: 3px solid #dc3545 !important;
    background: linear-gradient(135deg, #ffe6e6 0%, #fff0f0 100%);
}

.special-meds h3 {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%) !important;
}

.supplement-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

/* Supplement specific meal items */
#supplements .meal-items label {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    border-left: 4px solid #2196f3;
}

#supplements .meal-items label:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #e1f5fe 100%);
}

#supplements .special-meds .meal-items label {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    border-left: 4px solid #e91e63;
}

#supplements .special-meds .meal-items label:hover {
    background: linear-gradient(135deg, #f8bbd9 0%, #fce4ec 100%);
}