@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+KR:wght@400;600;700&display=swap');

/* ===== Design Tokens ===== */
:root {
    --background-color: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    --text-color: #1c1917;
    --container-bg-color: rgba(255, 255, 255, 0.95);
    --button-bg-color: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --button-hover-bg-color: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    --button-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    --toggle-bg: #ffedd5;
    --toggle-icon: #ea580c;
    --nav-bg: rgba(255, 255, 255, 0.6);
    --nav-border: rgba(15, 23, 42, 0.06);
    --nav-link: #78716c;
    --nav-link-active: #ea580c;
    --divider: rgba(15, 23, 42, 0.06);
    --input-bg: rgba(255, 255, 255, 0.7);
    --input-border: rgba(15, 23, 42, 0.12);
    --footer-bg: rgba(0, 0, 0, 0.03);
    --footer-text: #a8a29e;
    --tag-breakfast: linear-gradient(135deg, #0ea5e9, #38bdf8);
    --tag-lunch: linear-gradient(135deg, #22c55e, #4ade80);
    --tag-dinner: linear-gradient(135deg, #f97316, #fb923c);
}

body.dark-mode {
    --background-color: linear-gradient(135deg, #1c1917 0%, #292524 100%);
    --text-color: #fafaf9;
    --container-bg-color: rgba(41, 37, 36, 0.95);
    --button-bg-color: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    --button-hover-bg-color: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --button-shadow: 0 4px 15px rgba(251, 146, 60, 0.4);
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    --toggle-bg: #44403c;
    --toggle-icon: #fbbf24;
    --nav-bg: rgba(15, 23, 42, 0.5);
    --nav-border: rgba(148, 163, 184, 0.1);
    --nav-link: #a8a29e;
    --nav-link-active: #fb923c;
    --divider: rgba(148, 163, 184, 0.1);
    --input-bg: rgba(15, 23, 42, 0.7);
    --input-border: rgba(148, 163, 184, 0.2);
    --footer-bg: rgba(255, 255, 255, 0.03);
    --footer-text: #78716c;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background: rgba(249, 115, 22, 0.2);
    color: inherit;
}

body {
    font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--background-color);
    color: var(--text-color);
    transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
}

/* ===== Container ===== */
.container {
    text-align: center;
    padding: 3rem 3.5rem;
    background-color: var(--container-bg-color);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    max-width: 760px;
    width: 100%;
    border-top: 4px solid transparent;
    border-image: linear-gradient(135deg, #f97316, #fb7185, #8b5cf6) 1;
    border-image-slice: 1;
    overflow: hidden;
}

/* ===== Page Navigation ===== */
.page-nav {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.3rem;
    margin-bottom: 1.5rem;
    background: var(--nav-bg);
    border-radius: 12px;
    border: 1px solid var(--nav-border);
    backdrop-filter: blur(8px);
}

.page-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--nav-link);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.page-nav a:hover {
    background: rgba(249, 115, 22, 0.08);
    color: var(--nav-link-active);
}

.page-nav a[aria-current="page"] {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.page-nav .nav-icon {
    font-size: 1rem;
}

/* ===== Heading ===== */
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

body.dark-mode h1 {
    background: linear-gradient(135deg, #fdba74 0%, #fb923c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.95rem;
    color: #78716c;
    margin-bottom: 1.25rem;
}

body.dark-mode .subtitle {
    color: #a8a29e;
}

/* ===== Theme Toggle ===== */
#theme-toggle-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--toggle-bg);
    color: var(--toggle-icon);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 10;
}

#theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== CTA Button ===== */
#generate-btn {
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: var(--button-bg-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--button-shadow);
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    position: relative;
    overflow: hidden;
}

#generate-btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 52px;
    background: linear-gradient(135deg, #f97316, #fb7185, #f97316);
    z-index: -1;
    opacity: 0;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.05); }
}

#generate-btn:hover {
    background: var(--button-hover-bg-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

#generate-btn:active {
    transform: translateY(0);
}

/* ===== Weekly Link (as styled button) ===== */
.weekly-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ea580c;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: rgba(249, 115, 22, 0.06);
}

body.dark-mode .weekly-link {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.08);
}

.weekly-link:hover {
    background: rgba(249, 115, 22, 0.12);
    transform: translateY(-1px);
}

/* ===== Language Toggle ===== */
.lang-toggle {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.1);
    margin-bottom: 1.25rem;
}

body.dark-mode .lang-toggle {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.lang-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #92400e;
    text-decoration: none;
    transition: all 0.2s ease;
}

body.dark-mode .lang-option {
    color: #d6d3d1;
}

.lang-option[aria-current="page"] {
    background: linear-gradient(135deg, #f97316 0%, #fb7185 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.35);
}

.lang-option:hover {
    transform: translateY(-1px);
}

/* ===== Section Divider ===== */
.section-divider {
    height: 1px;
    background: var(--divider);
    margin: 2rem 0;
    border: none;
}

/* ===== Weekly Grid ===== */
.weekly .weekly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 0.5rem;
}

.weekly .weekly-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 0.5rem 0 1.25rem;
}

.weekly .filter-btn {
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #9a3412;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

body.dark-mode .weekly .filter-btn {
    background: rgba(15, 23, 42, 0.8);
    color: #fbbf24;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.weekly .filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.weekly .filter-btn.active {
    background: linear-gradient(135deg, #f97316 0%, #fb7185 100%);
    color: #fff;
    transform: translateY(-1px);
}

/* ===== Day Cards ===== */
.weekly .day-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.08);
    text-align: left;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.weekly .day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #f97316, #fb7185);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.weekly .day-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.weekly .day-card:hover::before {
    opacity: 1;
}

body.dark-mode .weekly .day-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.weekly .day-label {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #0f172a;
}

body.dark-mode .weekly .day-label {
    color: #e2e8f0;
}

.weekly .meal-row {
    font-size: 0.92rem;
    color: #44403c;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
}

body.dark-mode .weekly .meal-row {
    color: #cbd5f5;
}

.weekly .meal-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 0.15rem 0.5rem;
    margin-right: 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f97316 0%, #fb7185 100%);
    flex-shrink: 0;
}

/* Breakfast tags */
.weekly .meal-tag.tag-breakfast {
    background: var(--tag-breakfast);
}

/* Lunch tags */
.weekly .meal-tag.tag-lunch {
    background: var(--tag-lunch);
}

/* Dinner tags */
.weekly .meal-tag.tag-dinner {
    background: var(--tag-dinner);
}

/* ===== Grocery ===== */
.grocery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 0.5rem;
}

.grocery-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.grocery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

body.dark-mode .grocery-card {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.grocery-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: #0f172a;
}

body.dark-mode .grocery-title {
    color: #e2e8f0;
}

.grocery-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.grocery-item {
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
    color: #44403c;
}

body.dark-mode .grocery-item {
    color: #cbd5f5;
}

.grocery-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grocery-check input {
    width: 18px;
    height: 18px;
    accent-color: #f97316;
    cursor: pointer;
    border-radius: 4px;
}

.grocery-check label {
    cursor: pointer;
    transition: color 0.2s ease;
}

.grocery-check input:checked + label {
    text-decoration: line-through;
    opacity: 0.5;
}

/* ===== Contact Form ===== */
.contact-form-section {
    margin-top: 2.5rem;
    background-color: var(--container-bg-color);
    padding: 2rem;
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    text-align: left;
    border: 1px solid var(--divider);
}

.contact-form-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    text-align: center;
}

.contact-form-section p {
    font-size: 0.95rem;
    color: var(--subtitle-color, #78716c);
    margin-bottom: 1.5rem;
    text-align: center;
}

body.dark-mode .contact-form-section p {
    color: var(--subtitle-color-dark, #a8a29e);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.contact-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.15rem;
    letter-spacing: 0.01em;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    padding: 0.8rem 1rem;
    border: 1px solid var(--input-border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-color);
    background-color: var(--input-bg);
    transition: all 0.2s ease;
}

.contact-form input[type="text"]::placeholder,
.contact-form input[type="email"]::placeholder,
.contact-form textarea::placeholder {
    color: #a8a29e;
    font-weight: 400;
}

body.dark-mode .contact-form input[type="text"],
body.dark-mode .contact-form input[type="email"],
body.dark-mode .contact-form textarea {
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-color);
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-form button[type="submit"] {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    background: var(--button-bg-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--button-shadow);
    margin-top: 0.5rem;
    width: fit-content;
    align-self: center;
    font-family: inherit;
}

.contact-form button[type="submit"]:hover {
    background: var(--button-hover-bg-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

.contact-form button[type="submit"]:active {
    transform: translateY(0);
}

/* ===== Footer ===== */
.site-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--divider);
    text-align: center;
}

.site-footer p {
    font-size: 0.8rem;
    color: var(--footer-text);
    line-height: 1.6;
}

.site-footer a {
    color: #ea580c;
    text-decoration: none;
    font-weight: 500;
}

body.dark-mode .site-footer a {
    color: #fb923c;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* ===== Links Row ===== */
.links-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 2.5rem 2rem;
    }

    .weekly .weekly-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grocery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-nav {
        gap: 0.15rem;
    }

    .page-nav a {
        padding: 0.45rem 0.7rem;
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    #generate-btn {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }

    .weekly .weekly-grid {
        grid-template-columns: 1fr;
    }

    .lang-toggle {
        margin-bottom: 1rem;
    }

    .grocery-grid {
        grid-template-columns: 1fr;
    }

    .contact-form-section {
        padding: 1.5rem 1rem;
    }

    .page-nav {
        flex-wrap: wrap;
    }

    .page-nav a {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }

    .page-nav .nav-icon {
        display: none;
    }
}

/* ===== Content Sections ===== */
.content-section {
    margin-top: 2.5rem;
    text-align: left;
}

.content-section h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-section h2 .section-icon {
    font-size: 1.4rem;
}

.content-section > p {
    font-size: 0.92rem;
    color: #57534e;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

body.dark-mode .content-section > p {
    color: #a8a29e;
}

/* Tip Cards Grid */
.tip-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
}

.tip-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    padding: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tip-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1);
}

body.dark-mode .tip-card {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.12);
}

.tip-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-color);
}

.tip-card p {
    font-size: 0.82rem;
    color: #78716c;
    line-height: 1.6;
}

body.dark-mode .tip-card p {
    color: #a8a29e;
}

/* Info Banner */
.info-banner {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.06), rgba(251, 113, 133, 0.06));
    border: 1px solid rgba(249, 115, 22, 0.1);
    border-radius: 14px;
    padding: 1.2rem 1.4rem;
    margin-top: 1.25rem;
    text-align: left;
}

body.dark-mode .info-banner {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(251, 113, 133, 0.08));
    border-color: rgba(251, 146, 60, 0.15);
}

.info-banner p {
    font-size: 0.88rem;
    color: #57534e;
    line-height: 1.7;
}

body.dark-mode .info-banner p {
    color: #a8a29e;
}

.info-banner strong {
    color: var(--text-color);
}

/* Article Content (About, Privacy) */
.article-content {
    text-align: left;
    margin-top: 1.5rem;
}

.article-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 2rem 0 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--divider);
}

.article-content h2:first-child {
    margin-top: 0.5rem;
}

.article-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 1.25rem 0 0.4rem;
}

.article-content p {
    font-size: 0.92rem;
    color: #57534e;
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

body.dark-mode .article-content p {
    color: #a8a29e;
}

.article-content ul {
    padding-left: 1.2rem;
    margin-bottom: 0.75rem;
}

.article-content li {
    font-size: 0.92rem;
    color: #57534e;
    line-height: 1.8;
    margin-bottom: 0.3rem;
}

body.dark-mode .article-content li {
    color: #a8a29e;
}

.article-content a {
    color: #ea580c;
    text-decoration: none;
    font-weight: 500;
}

body.dark-mode .article-content a {
    color: #fb923c;
}

.article-content a:hover {
    text-decoration: underline;
}

.last-updated {
    font-size: 0.8rem;
    color: var(--footer-text);
    margin-top: 2rem;
    text-align: center;
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--nav-link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--nav-link-active);
}
