/* =========================================
   1. TEMEL AYARLAR VE DEĞİŞKENLER
   ========================================= */
:root {
    /* RENK PALETİ GÜNCELLEMESİ: Logo Uyumlu Kırmızı/Siyah */
    --primary-color: #212121; /* Logo siyahı ile uyumlu koyu antrasit */
    --accent-color: #c0392b;  /* Logodaki o tok Kırmızı (Pomegranate/Bordo) */
    --accent-hover: #a93226;  /* Hover durumunda daha koyu kırmızı */

    --bg-color: #f9f9f9;      /* Biraz daha nötr, temiz arka plan */
    --card-bg: #ffffff;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --border-radius: 16px;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 20px rgba(192, 57, 43, 0.15); /* Gölgelere hafif kırmızımsı ton */

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --success-green: #27ae60;

    /* Yeni Eklenen: Kırmızımsı arka plan gradyanı */
    --gradient-red-light: linear-gradient(135deg, #fff5f5 0%, #fceaea 100%);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex; flex-direction: column;
}

/* =========================================
   2. HEADER VE LOGO
   ========================================= */
.main-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; margin-bottom: 30px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.03);
    flex-wrap: wrap; gap: 20px;
}

.logo-area { display: flex; align-items: center; gap: 15px; }

.site-logo {
    height: 100px;
    width: auto;
    object-fit: contain;
    display: block;
}

@media (max-width: 768px) {
    .site-logo {
        height: 100px;
    }
}

.main-header h1 {
    font-family: var(--font-heading); font-size: 2.2rem;
    color: var(--primary-color); line-height: 1.1;
}

.subtitle { color: var(--text-light); font-size: 0.95rem; font-weight: 400; }

/* =========================================
   3. HEADER KONTROLLERİ (Pill Design)
   ========================================= */
.header-controls-wrapper {
    display: flex; align-items: center; gap: 15px; flex-wrap: wrap;
}

/* A. Yemekhane Seçimi */
.location-select-container {
    position: relative; background: white;
    border-radius: 50px; box-shadow: var(--shadow-sm);
    display: flex; align-items: center; padding: 0 15px;
    height: 50px; border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.location-select-container:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}
.custom-select {
    appearance: none; -webkit-appearance: none; border: none;
    background: transparent; padding: 10px 35px 10px 10px;
    font-size: 0.95rem; font-weight: 600; font-family: var(--font-body);
    color: var(--primary-color); cursor: pointer; outline: none;
    min-width: 180px;
}
.location-icon { color: var(--accent-color); font-size: 1.1rem; margin-right: 5px; }
.arrow-icon { position: absolute; right: 15px; color: var(--text-light); font-size: 0.8rem; pointer-events: none; }

/* B. Tarih Navigasyonu */
.date-nav-pill {
    display: flex; align-items: center; background: white;
    border-radius: 50px; box-shadow: var(--shadow-sm);
    padding: 5px; height: 50px; border: 1px solid rgba(0,0,0,0.05);
}
.nav-arrow {
    width: 40px; height: 40px; border-radius: 50%;
    border: none; background: transparent; color: var(--primary-color);
    cursor: pointer; transition: background 0.2s, color 0.2s;
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.nav-arrow:hover { background: #fff5f5; color: var(--accent-color); } /* Hover rengi kırmızımsı yapıldı */

.date-text-area {
    position: relative; padding: 0 20px; font-weight: 600;
    color: var(--primary-color); cursor: pointer; font-size: 1rem;
    user-select: none; border-left: 1px solid #eee; border-right: 1px solid #eee;
    min-width: 160px; text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 8px; height: 100%;
    transition: color 0.2s;
}
.date-text-area:hover { color: var(--accent-color); }

/* C. Giriş Butonu */
.login-btn {
    height: 50px; padding: 0 25px; border-radius: 50px;
    background: var(--accent-color); /* Giriş butonu artık Kırmızı (Accent) olsun ki logo ile patlasın */
    color: white;
    border: none; font-family: var(--font-body); font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 10px;
    transition: all 0.3s; box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4); /* Gölge kırmızımsı */
}
.login-btn:hover { background: var(--accent-hover); transform: translateY(-2px); }

@media (max-width: 768px) {
    .header-controls-wrapper { width: 100%; justify-content: center; }
    .location-select-container, .date-nav-pill { width: 100%; justify-content: space-between; }
    .custom-select { width: 100%; }
    .date-text-area { flex-grow: 1; }
    .login-text { display: none; }
    .login-btn { width: 50px; padding: 0; justify-content: center; }
}

/* =========================================
   4. NAVIGASYON VE GÖRÜNÜM SEÇİCİ
   ========================================= */
/* Öğün Tabları */
.meal-tabs {
    display: flex; justify-content: center; gap: 20px;
    margin-bottom: 30px; background: #e9ecef;
    padding: 5px; border-radius: 50px; width: fit-content;
    margin-left: auto; margin-right: auto;
}
.tab-btn {
    background: transparent; border: none; padding: 12px 35px;
    border-radius: 40px; font-family: var(--font-body); font-size: 1rem;
    font-weight: 500; color: var(--text-light); cursor: pointer;
    transition: all 0.3s ease; display: flex; align-items: center; gap: 8px;
}
.tab-btn:hover { color: var(--primary-color); }
.tab-btn.active {
    background: var(--card-bg); color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); font-weight: 600;
}
.vegan-tab:hover, .vegan-tab.active { color: var(--success-green); }

@media (max-width: 768px) {
    .meal-tabs { width: 100%; gap: 5px; padding: 5px; flex-wrap: wrap; }
    .tab-btn { padding: 10px 15px; flex: 1; justify-content: center; font-size: 0.9rem; }
}

/* Görünüm Seçici */
.view-switcher-container {
    display: flex; justify-content: center; gap: 10px; margin-bottom: 25px;
}
.view-btn {
    background: white; border: 1px solid rgba(0,0,0,0.05);
    padding: 10px 20px; border-radius: 30px; font-size: 0.9rem;
    font-weight: 600; color: var(--text-light); cursor: pointer;
    transition: all 0.2s; font-family: var(--font-body);
    display: flex; align-items: center; gap: 8px;
}
.view-btn:hover { background: #fff5f5; color: var(--accent-color); }
.view-btn.active {
    background: var(--primary-color); color: white; /* Aktif buton siyah kalsın, ciddiyet katar */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); border-color: transparent;
}

/* =========================================
   5. İÇERİK ALANLARI VE GÖRÜNÜMLER
   ========================================= */
.tab-content { display: none; animation: fadeIn 0.4s ease-out; }
.tab-content.active-content { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- A. GÜNLÜK GÖRÜNÜM --- */
.menu-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px; padding: 10px;
}
.menu-card {
    background: var(--card-bg); border-radius: 20px;
    box-shadow: var(--shadow-sm); transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.03); overflow: hidden;
    cursor: pointer; display: flex; flex-direction: column;
}
.menu-card:hover {
    transform: translateY(-5px); box-shadow: var(--shadow-md);
    border-color: rgba(192, 57, 43, 0.3); /* Hover border kırmızımsı */
}
.card-icon-header {
    height: 140px;
    /* DEĞİŞİKLİK: Turuncu gradyan yerine çok hafif kırmızı/pembe gradyan */
    background: var(--gradient-red-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-color); font-size: 3.5rem; transition: transform 0.3s;
}
.menu-card:hover .card-icon-header { transform: scale(1.05); }
.card-content {
    padding: 20px; flex-grow: 1; display: flex;
    flex-direction: column; text-align: center;
}
.meal-category {
    text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px;
    color: var(--text-light); font-weight: 600; margin-bottom: 8px;
}
.meal-title {
    font-family: var(--font-heading); font-size: 1.25rem;
    color: var(--text-dark); margin-bottom: 15px; line-height: 1.4;
}
.meal-meta { display: flex; justify-content: center; margin-top: auto; }
.cal-badge {
    display: flex; align-items: center; gap: 6px;
    background: #f8f9fa; padding: 6px 12px; border-radius: 20px;
    font-weight: 500; font-size: 0.9rem; color: var(--text-light);
}
.cal-badge i { color: var(--accent-color); } /* Ateş ikonu da artık tema kırmızısı */

/* --- B. HAFTALIK GÖRÜNÜM --- */
.weekly-list {
    display: flex; flex-direction: column; gap: 15px;
    max-width: 800px; margin: 0 auto;
}
.weekly-item {
    background: white;
    border-radius: 16px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.03);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}
.weekly-item:hover {
    transform: translateX(5px);
    border-left: 5px solid var(--accent-color);
    box-shadow: var(--shadow-md);
}
.weekly-date {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #f8f9fa; width: 60px; height: 60px; border-radius: 12px;
    color: var(--primary-color); font-weight: bold;
}
.w-day { font-size: 1.4rem; line-height: 1; }
.w-month { font-size: 0.8rem; text-transform: uppercase; color: var(--text-light); }
.weekly-content { flex-grow: 1; }
.weekly-content h4 { font-size: 1.1rem; color: var(--primary-color); margin-bottom: 4px; }
.weekly-content p { font-size: 0.9rem; color: var(--text-light); }
.weekly-item.current-day { border: 2px solid var(--accent-color); }
.weekly-item.current-day .weekly-date { background: var(--accent-color); color: white; }
.weekly-item.current-day .w-month { color: rgba(255,255,255,0.9); }
.weekly-arrow {
    margin-left: auto;
    color: #cbd5e0;
    font-size: 1rem;
    transition: all 0.2s;
}

.weekly-item:hover .weekly-arrow {
    color: var(--accent-color);
    transform: translateX(5px);
}

/* --- C. AYLIK GÖRÜNÜM --- */
.monthly-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px;
    background: white; padding: 20px; border-radius: 20px;
    box-shadow: var(--shadow-sm);
}
.m-head {
    text-align: center; font-weight: 700; color: var(--text-light);
    padding-bottom: 10px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px;
}
.m-day {
    position: relative; background: #ffffff; border: 1px solid #f0f0f0;
    border-radius: 12px; padding: 8px; min-height: 110px;
    cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column;
    overflow: hidden;
}
.m-day:hover {
    transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-color); z-index: 2;
}
.m-num { font-weight: 800; font-size: 1rem; color: var(--primary-color); margin-bottom: 6px; display: block; }

/* Bugün Stili - Kırmızı Vurgu */
.m-day.today { border: 2px solid var(--accent-color); background: #fff5f5; }
.m-day.today .m-num { color: var(--accent-color); }

.m-menu-list { display: flex; flex-direction: column; gap: 2px; }
.m-item {
    font-size: 0.7rem; color: var(--text-light); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.m-item.main-dish { font-weight: 700; color: var(--primary-color); font-size: 0.75rem; }

.m-day::after {
    content: '\f061'; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; bottom: 5px; right: 8px; font-size: 0.8rem;
    color: var(--accent-color); opacity: 0; transform: translateX(-10px);
    transition: all 0.3s;
}
.m-day:hover::after { opacity: 1; transform: translateX(0); }
.m-day.empty { border: none; background: transparent; cursor: default; }
.m-day.empty:hover { transform: none; box-shadow: none; }

@media (max-width: 900px) {
    .monthly-grid { grid-template-columns: repeat(1, 1fr); gap: 5px; }
    .m-day { flex-direction: row; align-items: center; min-height: auto; padding: 15px; gap: 15px; }
    .m-num { margin-bottom: 0; font-size: 1.2rem; min-width: 30px; }
    .m-menu-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .m-item::after { content: ", "; }
    .m-item:last-child::after { content: ""; }
    .m-head, .m-day.empty { display: none; }
}

/* =========================================
   6. MODAL VE POPUP
   ========================================= */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.6);
    z-index: 2000; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.modal-overlay.open { display: flex; animation: fadeIn 0.3s; }
.modal-content {
    background: white; width: 90%; max-width: 500px;
    border-radius: 24px; overflow: hidden; position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.close-modal {
    position: absolute; top: 15px; right: 20px;
    background: rgba(0,0,0,0.1); border: none; width: 32px; height: 32px;
    border-radius: 50%; font-size: 1.5rem; cursor: pointer; z-index: 10;
    display: flex; align-items: center; justify-content: center; color: var(--text-dark);
}
.close-modal:hover { background: rgba(0,0,0,0.2); }
.modal-header-icon {
    height: 150px;
    background: var(--gradient-red-light); /* Kırmızımsı arka plan */
    display: flex; align-items: center; justify-content: center;
    font-size: 4rem; color: var(--accent-color);
}
.modal-body { padding: 30px; text-align: center; }
.detail-category {
    display: block; font-size: 0.9rem; letter-spacing: 2px;
    text-transform: uppercase; color: var(--text-light); margin-bottom: 10px; font-weight: 600;
}
.modal-body h2 {
    font-family: var(--font-heading); font-size: 2rem;
    color: var(--primary-color); margin-bottom: 15px; line-height: 1.2;
}
.detail-badges { display: flex; justify-content: center; margin-bottom: 25px; }
.detail-badges .badge {
    background: #f8f9fa; padding: 8px 16px; border-radius: 50px;
    font-size: 0.95rem; font-weight: 500; color: var(--text-dark);
    display: flex; align-items: center; gap: 8px;
}
.ingredients-box {
    background: #f8f9fa; padding: 20px; border-radius: 12px;
    border-left: 4px solid var(--accent-color); text-align: left;
}
.ingredients-box h3 { font-size: 1rem; margin-bottom: 8px; color: var(--primary-color); }
.ingredients-box p { font-size: 0.95rem; color: #4a4a4a; }

/* Takvim Popup */
.calendar-popup {
    display: none; position: absolute; top: 55px; left: 50%;
    transform: translateX(-50%); width: 300px; background: white;
    border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1000; padding: 20px; border: 1px solid rgba(0,0,0,0.05);
}
.calendar-popup.active { display: block; animation: popupFade 0.2s ease-out; }
@keyframes popupFade {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.calendar-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px; font-weight: bold; color: var(--primary-color);
}
.cal-nav-btn {
    background: none; border: none; cursor: pointer;
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s; color: var(--text-light);
}
.cal-nav-btn:hover { background: #f0f0f0; color: var(--accent-color); }
.calendar-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr);
    text-align: center; font-size: 0.8rem; color: var(--text-light);
    margin-bottom: 10px; font-weight: 600;
}
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-day {
    height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; cursor: pointer; font-size: 0.9rem;
    transition: all 0.2s; color: var(--text-dark);
}
.cal-day:hover { background: #fff5f5; color: var(--accent-color); }
.cal-day.today { border: 2px solid var(--accent-color); color: var(--accent-color); font-weight: bold; }
.cal-day.selected { background: var(--accent-color); color: white; font-weight: bold; }
.cal-day.empty { pointer-events: none; }

/* =========================================
   7. DETAY SAYFASI ÖZEL
   ========================================= */
.detail-page-wrapper { max-width: 900px; margin: 0 auto; }
.back-btn {
    text-decoration: none; color: var(--text-light); font-weight: 500;
    display: flex; align-items: center; gap: 8px; padding: 10px 20px;
    background: white; border-radius: 30px; box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.back-btn:hover { color: var(--accent-color); transform: translateX(-3px); }
.detail-top-bar { margin-bottom: 30px; }
.summary-card {
    /* Burada da Koyu Gri'den Siyaha bir geçiş yaptık */
    background: linear-gradient(135deg, var(--primary-color), #000000);
    color: white; padding: 30px; border-radius: var(--border-radius);
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.summary-text { font-size: 1.2rem; font-weight: 500; opacity: 0.9; }
.summary-value { font-size: 2.2rem; font-family: var(--font-heading); font-weight: 700; color: #ff6b6b; } /* Accent'in açığı */

/* Footer */
footer {
    margin-top: auto; text-align: center; padding: 30px 0;
    color: var(--text-light); font-size: 0.9rem; border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* FLATPICKR TAKVİM AYARLARI */
.flatpickr-calendar {
    z-index: 99999 !important; /* En, en üstte olmalı */
    box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
    border: none !important;
    border-radius: 12px !important;
    font-family: var(--font-body) !important;
}

/* Takvim açıldığında okun görülebilmesi için */
.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
    border-bottom-color: white !important;
}

/* Günlerin üzerine gelince tema rengi olsun */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}
