/* ================================================================
   MESS PAGE — Premium Redesign
   Color palette inspired by physical menu card:
   Breakfast: Blue/Purple | Lunch: Yellow/Amber
   Snacks: Red/Pink     | Dinner: Green
   ================================================================ */

:root {
    --primary-color: #111111;
    --accent-color: #D4AF37;
    --bg-white: #FFFFFF;
    --bg-secondary: #F7F1E9;
    --bg-page: #f0f2f5;
    --text-main: #1f1f1f;
    --text-light: #6f6f6f;
    --border-radius: 24px;
    --box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
    --box-shadow-soft: 0 14px 32px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;

    /* Meal accent colors */
    --breakfast-from: #4A5FE0;
    --breakfast-to: #7B68EE;
    --breakfast-light: rgba(74, 95, 224, 0.08);
    --breakfast-tag: rgba(74, 95, 224, 0.1);
    --breakfast-tag-text: #4A5FE0;

    --lunch-from: #E8A317;
    --lunch-to: #FFC107;
    --lunch-light: rgba(232, 163, 23, 0.08);
    --lunch-tag: rgba(232, 163, 23, 0.1);
    --lunch-tag-text: #C28B00;

    --snacks-from: #E84393;
    --snacks-to: #FD79A8;
    --snacks-light: rgba(232, 67, 147, 0.08);
    --snacks-tag: rgba(232, 67, 147, 0.1);
    --snacks-tag-text: #E84393;

    --dinner-from: #00B894;
    --dinner-to: #55EFC4;
    --dinner-light: rgba(0, 184, 148, 0.08);
    --dinner-tag: rgba(0, 184, 148, 0.1);
    --dinner-tag-text: #00896E;

    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.05);
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --pill-bg: rgba(0, 0, 0, 0.04);
    --pill-active-bg: var(--primary-color);
    --pill-active-text: #ffffff;
    --pill-text: var(--text-main);
    --pill-hover: rgba(0, 0, 0, 0.07);
    --day-title-color: var(--text-main);
}

/* ================================================================
   DARK MODE
   ================================================================ */
[data-theme="dark"] {
    --bg-page: #0d0d0d;
    --card-bg: #1a1a1a;
    --card-border: rgba(255, 255, 255, 0.06);
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --pill-bg: rgba(255, 255, 255, 0.07);
    --pill-active-bg: #ffffff;
    --pill-active-text: #111111;
    --pill-text: #cccccc;
    --pill-hover: rgba(255, 255, 255, 0.12);
    --day-title-color: #ffffff;

    --breakfast-light: rgba(74, 95, 224, 0.12);
    --breakfast-tag: rgba(123, 104, 238, 0.18);
    --breakfast-tag-text: #a89cf7;

    --lunch-light: rgba(232, 163, 23, 0.12);
    --lunch-tag: rgba(255, 193, 7, 0.18);
    --lunch-tag-text: #ffd54f;

    --snacks-light: rgba(232, 67, 147, 0.12);
    --snacks-tag: rgba(253, 121, 168, 0.18);
    --snacks-tag-text: #fd79a8;

    --dinner-light: rgba(0, 184, 148, 0.12);
    --dinner-tag: rgba(85, 239, 196, 0.18);
    --dinner-tag-text: #55efc4;
}

/* ================================================================
   BASE LAYOUT
   ================================================================ */
body.mess-page {
    background: var(--bg-page);
    color: var(--text-main);
    overflow-x: hidden;
}

main {
    padding-top: 92px;
}

.section-block {
    max-width: 1240px;
    margin: 0 auto;
    padding: 64px 24px;
}

/* ================================================================
   MESS HERO BANNER
   ================================================================ */
.mess-hero-banner {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    margin-bottom: -40px;
}

.mess-hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.4) saturate(1.2);
}

.mess-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 12, 0.1) 0%,
        rgba(10, 10, 12, 0.8) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInDown 0.8s ease-out forwards;
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #4ade80;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.mess-hero-overlay h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: fadeInDown 0.8s ease-out 0.1s forwards;
    opacity: 0;
}

.mess-hero-overlay p {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    max-width: 540px;
    line-height: 1.6;
    animation: fadeInDown 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

/* ================================================================
   DASHBOARD SECTION
   ================================================================ */
.dashboard-section {
    padding: 56px 20px 80px;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ================================================================
   DAY NAVIGATION — Horizontal pill bar
   ================================================================ */
.day-nav-wrapper {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.day-nav-label {
    display: none; /* Cleaner without it */
}

.day-pills {
    list-style: none;
    padding: 6px;
    margin: 0;
    display: inline-flex;
    background: rgba(120, 120, 120, 0.08);
    border-radius: 999px;
    border: 1px solid rgba(120, 120, 120, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.day-pill {
    padding: 10px 24px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--text-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    white-space: nowrap;
}

.day-pill:hover {
    color: var(--text-main);
}

.day-pill.active {
    background: var(--pill-active-bg);
    color: var(--pill-active-text);
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: scale(1.02);
}

/* Mobile dropdown (hidden on desktop) */
.mobile-day-select {
    display: none;
    width: 100%;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-main);
    background-color: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 14px;
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f6f6f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.mobile-day-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* ================================================================
   DAY TITLE
   ================================================================ */
.selected-day-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.selected-day-header h2 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--day-title-color);
    line-height: 1.2;
}

.selected-day-header .day-icon {
    font-size: 1.6rem;
}

/* ================================================================
   MEALS GRID
   ================================================================ */
.meals {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* ================================================================
   MEAL CARD
   ================================================================ */
.meal-card {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(120, 120, 120, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: fadeInCard 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    position: relative;
    z-index: 1;
}

.meal-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 10;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.meal-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* ================================================================
   MEAL IMAGE SECTION (with badge overlay)
   ================================================================ */
.meal-image {
    position: relative;
    width: 100%;
    height: 200px;
    margin: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.meal-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 800ms ease, transform 6s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    z-index: 1;
    transform: scale(1.02);
}

.meal-card:hover .meal-image img {
    transform: scale(1.08);
}

.meal-image img.active {
    opacity: 1;
    z-index: 2;
}

.meal-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.05) 55%,
        rgba(0, 0, 0, 0.4) 100%
    );
    z-index: 3;
    pointer-events: none;
}

/* Badge floating over image */
.meal-header-badge {
    position: absolute;
    bottom: 14px;
    left: 14px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.meal-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.meal-header-text {
    display: flex;
    flex-direction: column;
}

.meal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.meal-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

/* ================================================================
   MEAL BODY — Dish tags
   ================================================================ */
.meal-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.dish-count {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.dish-count::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(120, 120, 120, 0.15);
}

.dish-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dish-tag {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
    border: 1px solid rgba(120, 120, 120, 0.08);
}

.dish-tag:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Per-meal tag colors */
.meal-card--breakfast .dish-tag {
    background: var(--breakfast-tag);
    color: var(--breakfast-tag-text);
}

.meal-card--lunch .dish-tag {
    background: var(--lunch-tag);
    color: var(--lunch-tag-text);
}

.meal-card--snacks .dish-tag {
    background: var(--snacks-tag);
    color: var(--snacks-tag-text);
}

.meal-card--dinner .dish-tag {
    background: var(--dinner-tag);
    color: var(--dinner-tag-text);
}

/* Color stripe at bottom of meal image */
.meal-card--breakfast .meal-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--breakfast-from), var(--breakfast-to));
    z-index: 4;
}

.meal-card--lunch .meal-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--lunch-from), var(--lunch-to));
    z-index: 4;
}

.meal-card--snacks .meal-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--snacks-from), var(--snacks-to));
    z-index: 4;
}

.meal-card--dinner .meal-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--dinner-from), var(--dinner-to));
    z-index: 4;
}

/* ================================================================
   IMPORTANT MESS NOTES SECTION
   ================================================================ */
.mess-notes-section {
    padding: 0 20px 80px;
}

.mess-notes-container {
    max-width: 1200px;
    margin: 0 auto;
}

.mess-notes-header {
    margin-bottom: 24px;
}

.notes-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.14);
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.mess-notes-header h2 {
    font-size: clamp(1.4rem, 2.2vw, 1.8rem);
    font-weight: 700;
    color: var(--day-title-color);
    margin-bottom: 6px;
}

.mess-notes-header p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.mess-notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.note-card {
    background: var(--card-bg);
    border: 1px solid rgba(120, 120, 120, 0.15);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: flex-start;
    gap: 18px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.note-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 10;
}

.note-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
}

.note-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(212, 175, 55, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    color: var(--day-title-color);
}

.note-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--day-title-color);
    margin-bottom: 6px;
    line-height: 1.3;
}

.note-content p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

/* ================================================================
   RESPONSIVE — Tablet
   ================================================================ */
@media (max-width: 900px) {
    .mess-hero-banner {
        height: 320px;
    }

    .day-pills {
        display: none;
    }

    .mobile-day-select {
        display: block;
    }

    .meals {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .dashboard-section {
        padding: 40px 16px 40px;
    }

    .mess-notes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mess-notes-section {
        padding: 0 16px 60px;
    }
}

/* ================================================================
   RESPONSIVE — Mobile
   ================================================================ */
@media (max-width: 580px) {
    main {
        padding-top: 70px;
    }

    .mess-hero-banner {
        height: 260px;
        margin-bottom: -24px;
    }

    .mess-hero-overlay h1 {
        font-size: 2rem;
    }

    .dashboard-section {
        padding: 32px 14px 50px;
    }

    .meal-image {
        height: 160px;
    }

    .meal-body {
        padding: 16px;
    }

    .dish-tag {
        padding: 5px 11px;
        font-size: 0.8rem;
    }

    .dish-tags {
        gap: 6px;
    }

    .selected-day-header h2 {
        font-size: 1.3rem;
    }
}

/* ================================================================
   LIGHTBOX STYLES (preserved from original)
   ================================================================ */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.92);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
