/* 기본 스타일 초기화 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary-color: #3182ce; /* Blue */
    --secondary-color: #2d3748; /* Dark Blue Gray */
    --text-color: #333;
    --background-color: #f4f7f6;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0,0,0,0.05);
    --shadow-hover-color: rgba(0,0,0,0.1);
    --category-color: #3182ce;
    --news-title-color: #1a202c; /* Will be used for general titles now */
    --news-desc-color: #718096; /* Will be used for general descriptions now */
    --news-footer-color: #a0aec0; /* Will be used for general footer text */
}

body.dark-mode {
    --primary-color: #63b3ed; /* Lighter Blue */
    --secondary-color: #a0aec0; /* Light Gray */
    --text-color: #e2e8f0;
    --background-color: #1a202c;
    --header-bg: #2d3748;
    --card-bg: #4a5568;
    --border-color: #2d3748;
    --shadow-color: rgba(0,0,0,0.2);
    --shadow-hover-color: rgba(0,0,0,0.3);
    --category-color: #63b3ed;
    --news-title-color: #ffffff;
    --news-desc-color: #cbd5e0;
    --news-footer-color: #a0aec0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}
a { text-decoration: none; color: inherit; }

/* 헤더 */
header {
    background-color: var(--header-bg);
    padding: 1.5rem 5%;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary-color);
    text-align: center;
    flex-shrink: 0; /* Prevent shrinking */
    padding-right: 20px; /* Space between logo and nav */
}
.logo span { color: var(--primary-color); }

/* 네비게이션 - 카테고리 */
nav#lunch-categories {
    display: flex;
    flex-grow: 1; /* Allow it to take available space */
    justify-content: flex-start; /* Align categories to start */
    gap: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--news-desc-color);
    margin-top: 0; /* Reset margin from old nav */
    flex-wrap: wrap;
}
nav#lunch-categories a {
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
}
nav#lunch-categories a:hover {
    color: var(--primary-color);
    background-color: var(--border-color);
}
nav#lunch-categories a.active {
    background-color: var(--primary-color);
    color: white;
}

/* 메인 컨텐츠 */
main { max-width: 1100px; margin: 2rem auto; padding: 0 20px; }
.section-title { font-size: 1.5rem; margin-bottom: 1.5rem; border-left: 5px solid var(--primary-color); padding-left: 15px; }


/* --- Lunch Recommender Styles --- */
#lunch-recommender {
    max-width: 800px;
    margin: 4rem auto;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow-color);
    text-align: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#lunch-result-display {
    min-height: 250px; /* Give some space even when empty */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background-color: var(--background-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#lunch-placeholder {
    font-size: 1.2rem;
    color: var(--news-desc-color);
}

#lunch-result.hidden {
    display: none;
}

#lunch-result img#lunch-image {
    max-width: 100%;
    height: 150px;
    object-fit: contain; /* Keep aspect ratio and fit within bounds */
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: #edf2f7; /* Placeholder background */
}

#lunch-result h3#lunch-name {
    font-size: 2rem;
    color: var(--news-title-color);
    margin-bottom: 0.5rem;
}

#lunch-result p#lunch-description {
    font-size: 1.1rem;
    color: var(--news-desc-color);
    margin-bottom: 1rem;
}

button#start-recommendation {
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}
button#start-recommendation:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}
button#start-recommendation:active {
    transform: translateY(0);
}


/* 푸터 */
footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--news-footer-color);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 15px;
}
.footer-links a {
    color: var(--news-footer-color);
    text-decoration: underline;
}
.footer-links a:hover {
    color: var(--primary-color);
}

/* Theme Toggle Button Style */
#theme-toggle {
    margin-left: 20px;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.2rem; /* Make emoji readable */
    line-height: 1; /* Fix vertical alignment */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 반응형 조절 */
@media (max-width: 600px) {
    header { flex-direction: column; align-items: flex-start; padding: 1rem 5%; }
    .logo { padding-right: 0; margin-bottom: 1rem; }
    nav#lunch-categories { justify-content: flex-start; width: 100%; margin-bottom: 1rem; }
    #theme-toggle { margin-left: 0; align-self: flex-end; } /* Align toggle to bottom right of header */
    .footer-links { flex-direction: column; gap: 5px; }
}
