:root {
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 20, 0.7);
    --gold: #D4AF37;
    --gold-light: #F4DF8D;
    --text-main: #FFFFFF;
    --text-muted: #A0A0A0;
    --border-color: rgba(212, 175, 55, 0.3);
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Montserrat', sans-serif;
}

/* Light Mode Variables */
/* Light Mode Variables - Premium/Luxury Aesthetics */
.light-mode {
    --bg-color: #F9F9F7;
    /* Warm off-white/cream instead of clinical white */
    --card-bg: #FFFFFF;
    /* Pure white cards for subtle lift */
    --text-main: #2C3E50;
    /* Deep charcoal for readability, softer than black */
    --text-muted: #666666;
    /* Elegant medium gray */
    --border-color: rgba(180, 142, 37, 0.4);
    /* Darker, more visible gold for light bg */
    --gold: #B48E25;
    /* Darker antique gold for contrast against white */
    --gold-light: #D4AF37;
    /* Standard gold for highlights */
}

body.light-mode {
    background-image: radial-gradient(circle at 50% 0%, #ffffff 0%, #F0F0EB 60%, #E6E6DE 100%);
}

.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
}

.theme-toggle:hover {
    background: var(--gold);
    color: var(--bg-color);
}

.hidden {
    display: none !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 10%, #1a1a2e 0%, #000000 70%);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Atmospheric Overlay */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.transparenttextures.com/patterns/stardust.png');
    /* Subtle noise */
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

/* Header Typography */
.header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInDown 1.5s ease-out;
}

.logo {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, var(--gold-light), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.1);
}

.light-mode .logo {
    background: linear-gradient(to right, #2C3E50, var(--gold), #2C3E50);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.gold-text {
    color: var(--gold);
    font-style: italic;
    -webkit-text-fill-color: var(--gold);
    /* Override gradient for this span if needed */
}

.subtitle {
    font-family: var(--font-body);
    font-weight: 200;
    letter-spacing: 0.3em;
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    border-top: 1px solid var(--border-color);
    display: inline-block;
    padding-top: 1rem;
    margin-top: 0.5rem;
}

/* Search Section */
.search-section {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 4rem;
    animation: fadeInUp 1.5s ease-out 0.5s backwards;
}

/* Mode Selection Section */
.mode-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
    margin-bottom: 4rem;
    animation: fadeInUp 1.5s ease-out 0.5s backwards;
}

.mode-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.mode-card:hover {
    transform: translateY(-10px);
    background: rgba(40, 40, 40, 0.8);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(212, 175, 55, 0.2);
}

.light-mode .mode-card:hover {
    background: #FFFFFF;
    box-shadow: 0 20px 40px rgba(180, 142, 37, 0.15);
    border-color: var(--gold);
}

.mode-card .card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--gold);
}

.mode-card .card-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.mode-card .mode-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.back-link {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--gold);
}

.input-group {
    position: relative;
    width: 100%;
    display: flex;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border-radius: 50px;
    /* Pill shape */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
}

.search-icon {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 1.2rem;
}

input[type="text"] {
    width: 100%;
    padding: 1.5rem 2rem 1.5rem 4.5rem;
    /* Space for icon */
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1.1rem;
    outline: none;
}

input[type="text"]::placeholder {
    color: var(--text-muted);
    font-weight: 200;
}

.gold-button {
    background: linear-gradient(135deg, var(--gold), #B8860B);
    color: #000;
    border: none;
    padding: 0 3rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    margin: 0.5rem;
    /* Small margin inside container */
}

.gold-button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.api-key-container {
    width: 100%;
    text-align: center;
    display: none;
    /* Hidden by default as we use hardcoded key */
}

/* Results Section */
.results-section {
    width: 100%;
    text-align: center;
    transition: opacity 0.5s ease;
}

.results-section.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.results-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.results-subtitle {
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 3rem;
}

/* Quiz Styles */
.quiz-section {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 1.5s ease-out 0.5s backwards;
}

.quiz-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.light-mode .quiz-container {
    background: #FFFFFF;
    box-shadow: 0 20px 40px rgba(180, 142, 37, 0.1);
}

.quiz-progress {
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: 600;
}

.quiz-question-text {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    /* Initial size, can be adjusted via JS for long questions */
    margin-bottom: 2.5rem;
    color: var(--text-main);
    line-height: 1.2;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
}

.quiz-option-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 1.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    position: relative;
}

.quiz-option-btn:hover {
    border-color: var(--gold);
    color: var(--text-main);
    background: rgba(212, 175, 55, 0.05);
}

.quiz-option-btn.selected {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: 600;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.quiz-option-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
    /* If using icons later */
}

/* Grid System */
.perfume-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    width: 100%;
}

/* Perfume Card */
.perfume-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.perfume-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.perfume-card:hover {
    transform: translateY(-10px);
    background: rgba(40, 40, 40, 0.8);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(212, 175, 55, 0.2);
}

.light-mode .perfume-card:hover {
    background: #FFFFFF;
    box-shadow: 0 20px 40px rgba(180, 142, 37, 0.15);
    border-color: var(--gold);
}

.perfume-card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.card-brand {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Loader */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    margin-top: auto;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
}