:root {
    --primary: #8e24aa;
    --primary-gradient: linear-gradient(135deg, #8e24aa 0%, #ba68c8 100%);
    --secondary: #ff6f00;
    --bg-light: #f8f9fa;
    --text-main: #2d3436;
    --text-sub: #636e72;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(142, 36, 170, 0.15);
    --radius: 16px;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    padding: 5rem 1.5rem;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, #f3e5f5 0%, #ffffff 70%);
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--text-main);
    letter-spacing: -1px;
}

.highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.hero-content p {
    font-size: 1.15rem;
    color: var(--text-sub);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

/* App Container */
.app-container {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    margin-top: 2rem;
    border: 1px solid rgba(255,255,255,0.5);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

button {
    border: none;
    padding: 16px;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-family: inherit;
}

.primary-action {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(142, 36, 170, 0.2);
}

.primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(142, 36, 170, 0.3);
}

.primary-action:active {
    transform: translateY(0);
}

.secondary-action {
    background: white;
    border: 2px solid #f0f0f0;
    color: var(--text-main);
}

.secondary-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fafafa;
}

.or-divider {
    color: #b2bec3;
    font-size: 0.85rem;
    margin: 8px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Media & Preview */
#media-container {
    margin-top: 24px;
}

#webcam-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-sm);
}

#webcam-container canvas, #uploaded-image {
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    display: block;
    margin: 0 auto;
}

#snapshot-btn {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: var(--primary);
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.5);
}

#snapshot-btn:hover {
    background: white;
    transform: translateX(-50%) scale(1.05);
}

/* Result Card */
#result-container {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px dashed #e0e0e0;
}

.detecting-label {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
    display: block;
}

#mood-label {
    margin: 0 0 24px 0;
    color: var(--text-main);
    font-size: 2rem;
    letter-spacing: -1px;
}

.food-card {
    background: #fff;
    border: 2px solid #f3e5f5;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.food-card h3 {
    color: var(--text-sub);
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#label-container {
    display: none;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Info Section */
.info-section, .faq-section {
    padding: 5rem 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.content-wrapper h2 {
    text-align: center;
    color: var(--text-main);
    margin-bottom: 3.5rem;
    font-size: 2rem;
    letter-spacing: -1px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

/* FAQ */
.faq-list details {
    background: white;
    margin-bottom: 1rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.faq-list summary {
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    position: relative;
    padding-right: 3rem;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 300;
}

.faq-list details[open] summary::after {
    content: '-';
}

.faq-list p {
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin: 0;
    color: var(--text-sub);
    border-top: 1px solid #f5f5f5;
    padding-top: 1rem;
}

/* Footer */
footer {
    background: #f8f9fa;
    padding: 3rem 1.5rem;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid #eee;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 1.5rem;
}

.footer-nav a {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.footer-nav a:hover {
    color: var(--primary);
}

footer p {
    color: #b2bec3;
    font-size: 0.9rem;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .hero-content h1 { font-size: 2.2rem; }
    .nav-links { display: none; } /* Hide nav links on mobile for simplicity, or add hamburger later */
    .app-container { padding: 1.5rem; }
    .feature-card { padding: 2rem; }
}