: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);
}

/* Language Selector */
.language-selector {
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(142, 36, 170, 0.3);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    font-family: inherit;
}

.language-selector:hover {
    border-color: var(--primary);
}

.language-selector:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(142, 36, 170, 0.1);
}

/* 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-video, #webcam-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);
}

#switch-camera-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: var(--text-main);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border: none;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

#switch-camera-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* 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;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3e5f5;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content p {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mood Buttons Section */
.mood-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1rem;
    color: var(--text-sub);
    margin-bottom: 1rem;
    font-weight: 600;
}

.mood-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
}

.mood-btn:hover {
    background: #f3e5f5;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.mood-emoji {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.mood-label {
    font-size: 0.75rem;
    color: var(--text-main);
    font-weight: 600;
}

/* Text Input Section */
.text-input-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #e0e0e0;
}

.text-input-wrapper {
    display: flex;
    gap: 10px;
}

#mood-text-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

#mood-text-input:focus {
    outline: none;
    border-color: var(--primary);
}

#mood-text-input::placeholder {
    color: #b2bec3;
}

.text-submit-btn {
    padding: 14px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    width: auto;
}

.text-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(142, 36, 170, 0.3);
}

.or-divider-main {
    color: #b2bec3;
    font-size: 0.9rem;
    margin: 1.5rem 0;
    font-weight: 600;
    text-align: center;
    position: relative;
}

.or-divider-main::before,
.or-divider-main::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #e0e0e0;
}

.or-divider-main::before {
    left: 0;
}

.or-divider-main::after {
    right: 0;
}

/* Multiple Food Recommendations */
.food-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.food-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fafafa;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.food-item:first-child {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ffb74d;
}

.food-item:hover {
    transform: translateX(4px);
}

.food-rank {
    font-size: 1.5rem;
}

.food-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.food-item:first-child .food-name {
    color: #e65100;
}

/* Find Restaurant Button */
.find-restaurant-btn {
    margin-left: auto;
    padding: 8px 12px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.find-restaurant-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.find-restaurant-btn:active {
    transform: scale(0.98);
}

/* Mobile - hide text, show only icon */
@media (max-width: 500px) {
    .find-restaurant-btn .btn-text {
        display: none;
    }

    .find-restaurant-btn {
        padding: 8px 10px;
        font-size: 1rem;
    }
}

/* Re-recommend Button */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.retry-btn {
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(142, 36, 170, 0.3);
}

.reset-btn {
    padding: 12px 24px;
    background: #f0f0f0;
    color: var(--text-main);
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
}

.reset-btn:hover {
    background: #e0e0e0;
}

/* Share Buttons */
.share-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed #e0e0e0;
}

.share-title {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 12px;
    font-weight: 600;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.share-btn {
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    border: none;
}

.share-btn.twitter {
    background: #1DA1F2;
    color: white;
}

.share-btn.facebook {
    background: #4267B2;
    color: white;
}

.share-btn.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.share-btn.copy {
    background: #f0f0f0;
    color: var(--text-main);
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .hero-content h1 { font-size: 2.2rem; }
    .app-container { padding: 1.5rem; }
    .feature-card { padding: 2rem; }

    /* Hamburger visible on mobile */
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 80px 30px 30px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 100;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 0;
    }

    .nav-links a {
        display: block;
        padding: 15px 0;
        font-size: 1.1rem;
        border-bottom: 1px solid #f0f0f0;
    }

    /* Mood buttons 2 rows on mobile */
    .mood-buttons {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .mood-btn {
        padding: 10px 4px;
    }

    .mood-emoji {
        font-size: 1.3rem;
    }

    .mood-label {
        font-size: 0.65rem;
    }

    /* Text input stack on mobile */
    .text-input-wrapper {
        flex-direction: column;
    }

    .text-submit-btn {
        width: 100%;
    }

    .share-buttons {
        flex-wrap: wrap;
    }

    .share-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}