/* ========== ROOT VARIABLES (ENHANCED THEME) ========== */
:root {
    /* Base Theme (Navy/Gold/Cream) */
    --navy-primary: #1a252f;
    --navy-secondary: #2c3e50;
    --gold-accent: #c0a062;
    --cream-bg: #f9f9f7;
    --white: #ffffff;
    --text-dark: #333333;
    --text-muted: #666666;
    
    /* Added Colors from Reference (For Highlights) */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* The purple/blue pop */
    --success-gradient: linear-gradient(135deg, #10b981, #059669);
    --hover-bg: #f0f4ff; /* Light blue tint for hovers */
    --active-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    
    /* Layout */
    --radius: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ========== GENERAL STYLES ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--cream-bg);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, .main-title, .step-num {
    font-family: 'Playfair Display', serif;
}

/* ========== NAVBAR (UNCHANGED) ========== */
.navbar { display: flex; justify-content: center; padding: 15px 0; background: var(--white); position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); border-bottom: 3px solid var(--navy-primary); }
.nav-container { width: 100%; max-width: 1200px; padding: 0 40px; display: flex; justify-content: space-between; align-items: center; }
.logo-section { display: flex; align-items: center; gap: 15px; }
.logo-image { width: 40px; height: 40px; }
.logo-text { font-size: 1.2em; font-weight: 700; color: var(--navy-primary); letter-spacing: -0.5px; font-family: 'Playfair Display', serif; }
.nav-links { display: flex; gap: 5px; }
.nav-link { padding: 10px 20px; color: var(--navy-primary); text-decoration: none; font-weight: 600; border-radius: var(--radius); transition: var(--transition); font-size: 0.95em; }
.nav-link:hover, .nav-link.active { color: var(--gold-accent); background: rgba(26, 37, 47, 0.05); }
.btn-login-nav { border: 1px solid var(--navy-primary); padding: 8px 20px; }
.hamburger { display: none; flex-direction: column; cursor: pointer; gap: 5px; }
.hamburger span { width: 25px; height: 3px; background: var(--navy-primary); border-radius: 3px; transition: var(--transition); }

@media (max-width: 800px) {
    .nav-links { position: fixed; top: 70px; left: -100%; height: calc(100vh - 10px); width: 60%; background: rgba(26, 26, 46, 0.98); backdrop-filter: blur(10px); flex-direction: column; padding: 20px 0; transition: left 0.3s ease-out; z-index: 999; }
    .nav-links.active { left: 0; }
    .nav-links .nav-link { color: var(--gold-accent); padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0; }
    .hamburger { display: flex; }
}

/* ========== HEADER SECTION ========== */
.container { max-width: 1200px; margin: 0 auto; padding: 40px; }

.header-professional {
    background-color: var(--navy-primary);
    background-image: radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.15) 0%, transparent 20%); /* Blue tint */
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    margin: 20px 0 40px 0;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    color: var(--white);
    border-bottom: 4px solid var(--gold-accent);
}

.header-content-pro { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 30px; }
.title-wrapper { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 300px; }

.hero-icon-container {
    font-size: 2.5em;
    color: var(--gold-accent);
    background: rgba(255, 255, 255, 0.1);
    width: 70px; height: 70px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(192, 160, 98, 0.4);
}

.main-title { font-size: 2.5em; color: var(--white); margin-bottom: 5px; line-height: 1.1; }
.main-subtitle { font-size: 1.05em; color: rgba(255,255,255,0.8); font-weight: 300; }

.header-stats-grid { display: flex; gap: 15px; }
.stat-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 15px;
    border-radius: var(--radius);
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; font-size: 0.85em; color: var(--white);
    transition: var(--transition);
    min-width: 100px;
}
.stat-badge:hover { background: rgba(102, 126, 234, 0.3); transform: translateY(-3px); }
.stat-badge i { color: var(--gold-accent); font-size: 1.3em; }

/* ========== AI ADVISOR FORM ========== */
.ai-advisor-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #eee;
    max-width: 950px;
    margin: 0 auto 50px auto;
}

.card-header-strip { height: 5px; background: var(--primary-gradient); } /* Added color gradient here */

.ai-advisor-content { padding: 40px; }

/* Section Styling */
.advisor-section { margin-bottom: 40px; position: relative; }

.section-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0; padding-bottom: 8px;
}

.step-num {
    font-size: 1.4em;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; /* Colored Numbers */
}

.advisor-section h3 { font-size: 1.3em; color: var(--navy-primary); margin: 0; font-weight: 700; }
.optional-tag { font-size: 0.8em; color: var(--text-muted); font-style: italic; margin-left: auto; }

/* 1. Location Input */
.location-wrapper { display: flex; gap: 10px; }
.input-with-icon { position: relative; flex-grow: 1; }
.location-search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--navy-secondary); }

.advisor-input-modern {
    width: 100%; padding: 14px 14px 14px 45px;
    border: 1px solid #ddd; border-radius: var(--radius);
    font-family: 'Lato', sans-serif; font-size: 1em;
    transition: var(--transition); background: #fdfdfd;
}
.advisor-input-modern:focus { border-color: #667eea; outline: none; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); }

.btn-location-modern {
    padding: 0 25px; background: var(--navy-secondary); color: white;
    border: none; border-radius: var(--radius); font-weight: 600;
    cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn-location-modern:hover { background: var(--navy-primary); transform: translateY(-2px); }

/* 2 & 3. COMPACT Grid Layout for Age/Gender (Fixing Spacing) */
.form-grid-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr; /* Give Age column slightly more space */
    gap: 30px; /* Reduced gap from 50px */
}

.selection-grid { display: grid; gap: 10px; }
.age-grid { grid-template-columns: repeat(2, 1fr); }
.gender-grid { grid-template-columns: repeat(3, 1fr); }

/* Tile Buttons - Making them nicer */
.select-tile {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius);
    padding: 15px 10px; /* Reduced padding to fix "ridiculous empty space" */
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; transition: var(--transition); color: var(--text-dark);
    min-height: 85px; /* Consistent height */
    position: relative;
    overflow: hidden;
}

.select-tile i { font-size: 1.4em; color: var(--navy-secondary); transition: color 0.3s; }
.select-tile span { font-weight: 600; font-size: 0.9em; }
.select-tile small { font-size: 0.75em; color: var(--text-muted); }

/* Tile Hover & Active */
.select-tile:hover {
    border-color: #667eea;
    background: var(--hover-bg);
    transform: translateY(-2px);
}

.select-tile.selected {
    background: var(--primary-gradient); /* Adding the colorful gradient */
    border-color: transparent;
    color: var(--white);
    box-shadow: var(--active-shadow);
}

.select-tile.selected i, .select-tile.selected small { color: rgba(255,255,255,0.9); }

/* Specific Age Input - Integrated Better */
.specific-age-wrapper {
    margin-top: 15px;
    display: flex; align-items: center; gap: 15px;
    padding-top: 10px; border-top: 1px dashed #eee;
}
.or-divider { font-size: 0.8em; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }

.floating-label-input { position: relative; flex-grow: 1; }
.modern-input {
    width: 100%; padding: 10px 12px;
    border: 1px solid #ddd; border-radius: var(--radius);
    font-size: 0.95em; background: transparent;
}
.modern-input:focus { border-color: #667eea; outline: none; }
.floating-label-input label {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 0.85em; pointer-events: none;
    transition: 0.2s; background: white; padding: 0 4px;
}
.modern-input:focus + label, .modern-input:not(:placeholder-shown) + label { top: 0; font-size: 0.75em; color: #667eea; font-weight: 600; }

/* 4. Time Slider Grid */
.time-slider-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.time-tile {
    padding: 12px 5px;
    border: 1px solid #ddd; border-radius: var(--radius);
    background: white; cursor: pointer; text-align: center;
    transition: var(--transition);
}
.time-tile span { display: block; font-size: 0.75em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.time-tile strong { display: block; font-size: 1em; color: var(--navy-primary); font-weight: 700; margin-top: 3px; }

.time-tile:hover { border-color: #667eea; background: var(--hover-bg); }
.time-tile.selected {
    background: var(--navy-primary); /* Keeping Navy for Time to balance colors */
    border-color: var(--navy-primary);
}
.time-tile.selected span { color: var(--gold-accent); }
.time-tile.selected strong { color: white; }

/* 5. Conditions Grid (Colorful Pills) */
.conditions-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.condition-chip {
    padding: 8px 16px;
    border: 1px solid #e0e0e0; border-radius: 50px;
    background: white; cursor: pointer;
    font-size: 0.9em; color: var(--text-dark);
    display: flex; align-items: center; gap: 8px;
    transition: var(--transition);
}
.condition-chip i { color: var(--navy-secondary); font-size: 1em; }

.condition-chip:hover { background: var(--hover-bg); border-color: #667eea; }

.condition-chip.selected {
    background: var(--primary-gradient); /* Colorful gradient for conditions */
    color: white; border-color: transparent;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.2);
}
.condition-chip.selected i { color: white; }

/* 6. Questions & Tags */
.quick-tags-container { margin-bottom: 20px; }
.tags-label { font-size: 0.85em; color: var(--text-muted); margin-bottom: 8px; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-btn {
    background: #f0f4f8; border: none; padding: 6px 14px;
    border-radius: 4px; font-size: 0.85em; color: var(--navy-primary);
    cursor: pointer; transition: var(--transition); font-weight: 600;
}
.tag-btn:hover { background: var(--gold-accent); color: white; transform: translateY(-2px); }

.custom-query-box { position: relative; }
.query-icon { position: absolute; top: 15px; left: 15px; color: var(--gold-accent); }
.advisor-textarea-modern {
    width: 100%; padding: 15px 15px 30px 45px;
    border: 1px solid #ddd; border-radius: var(--radius);
    font-family: 'Lato', sans-serif; font-size: 1em; background: #fdfdfd;
    resize: vertical; transition: var(--transition);
}
.advisor-textarea-modern:focus { border-color: #667eea; outline: none; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); }
.word-count { position: absolute; bottom: 10px; right: 15px; font-size: 0.75em; color: var(--text-muted); }

/* Submit Button */
.form-actions { text-align: center; margin-top: 30px; }
.btn-generate-advice {
    background: linear-gradient(135deg, var(--gold-accent) 0%, #d4b06d 100%);
    color: var(--navy-primary); border: none; padding: 16px 50px;
    border-radius: 50px; font-size: 1.1em; font-weight: 700;
    cursor: pointer; transition: var(--transition); position: relative; overflow: hidden;
    box-shadow: 0 10px 20px rgba(192, 160, 98, 0.3);
}
.btn-generate-advice:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(192, 160, 98, 0.4); background: var(--white); }

/* ========== AI RESPONSE CONTAINER ========== */
.ai-response-container { 
    margin-top: 40px; 
    animation: fadeIn 0.5s ease-out; 
}

.response-card { 
    background: #fcfcfc; 
    border: 1px solid #eee; 
    border-left: 5px solid #667eea; 
    border-radius: var(--radius); 
    padding: 40px 30px; /* Increased top padding for better flow */
    position: relative; 
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); /* Card level shadow */
}

.response-header-modern { 
    display: flex; 
    flex-direction: column; /* Stacked for a cleaner centered look */
    align-items: center; 
    gap: 10px; 
    margin-bottom: 30px; 
    padding-bottom: 20px; 
    border-bottom: 1px solid #eee; 
}

.bot-avatar { 
    width: 55px; 
    height: 55px; 
    background: var(--primary-gradient); 
    color: white; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.4em; 
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.response-header-modern h4 { 
    margin: 0; 
    font-size: 1.4em; 
    color: var(--navy-primary); 
    font-family: 'Playfair Display', serif;
}

.response-date { 
    text-align: center;
    font-size: 0.85em; 
    color: var(--text-muted); 
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== CENTERED & INLINED RESPONSE BODY ========== */
.response-body {
    line-height: 1.8;
    color: var(--text-dark);
    font-size: 1.08em;
    font-family: 'Lato', sans-serif;
    text-align: center; /* Centered as requested */
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03); /* Professional inner box shadow */
    background-color: rgba(198, 255, 228, 0.2);
}

/* Professional Headers inside AI Text */
.response-body strong, 
.response-body b {
    color: var(--navy-primary);
    font-weight: 700;
    display: block;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.2em;
    font-family: 'Playfair Display', serif;
    position: relative;
}

/* Small gold underline for headers to anchor the center text */
.response-body strong::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--gold-accent);
    margin: 8px auto 0;
}

/* Centered Lists */
.response-body ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: inline-block; /* Helps center the list itself */
    text-align: left; /* Keep text left-aligned inside the centered block for readability */
}

.response-body li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.response-body li::before {
    content: "•";
    color: var(--gold-accent);
    font-weight: bold;
    font-size: 1.5em;
    position: absolute;
    left: 5px;
    top: -4px;
}

.response-body p {
    margin-bottom: 20px;
}

/* ========== MINI LIVE CONTEXT (Bottom Text) ========== */
.mini-aqi-summary {
    text-align: left;
    margin-top: 30px;
    padding: 20px;
    background: #f8faff;
    border-radius: var(--radius);
    font-size: 0.95em;
    border: 1px solid #e1e8f5;

}

.mini-header {
    font-weight: 700;
    color: var(--navy-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}


.info-cards-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 60px; }
.info-card { background: var(--white); padding: 25px; text-align: center; border-radius: var(--radius); box-shadow: var(--shadow-sm); border-top: 3px solid var(--gold-accent); transition: var(--transition); }
.info-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.info-card-icon { font-size: 2em; color: var(--navy-secondary); margin-bottom: 10px; }
.info-card h3 { color: var(--navy-primary); margin-bottom: 8px; font-size: 1.1em; }
.info-card p { color: var(--text-muted); font-size: 0.9em; }

.attribution-pro { text-align: center; color: var(--text-muted); margin-bottom: 30px; font-size: 0.9em; }
.attribution-pro a { color: var(--navy-primary); font-weight: 700; text-decoration: none; }

/* Footer (Matching Base) */
.footer { background: var(--navy-primary); color: white; padding: 60px 40px 20px; margin-top: 0; }
.footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-section h3 { font-size: 1.4em; color: var(--white); margin-bottom: 15px; font-family: 'Playfair Display', serif; }
.footer-section p { color: var(--gold-light); line-height: 1.7; font-size: 0.95em; }
.footer-section h4 { font-size: 1.1em; color: var(--gold-accent); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; }
.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 10px; }
.footer-section ul li a { color: rgba(255, 255, 255, 0.7); text-decoration: none; transition: color 0.3s; font-size: 0.95em; }
.footer-section ul li a:hover { color: var(--gold-accent); padding-left: 5px; }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); text-align: center; font-size: 0.9em; color: rgba(255,255,255,0.6); }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .form-grid-layout { grid-template-columns: 1fr; gap: 30px; }
    .ai-advisor-content { padding: 30px 20px; }
    .header-content-pro { flex-direction: column; text-align: center; }
    .title-wrapper { justify-content: center; }
}

@media (max-width: 600px) {
    .container { padding: 20px 15px; }
    .age-grid { grid-template-columns: 1fr 1fr; }
    .gender-grid { grid-template-columns: 1fr 1fr 1fr; }
    .time-slider-grid { grid-template-columns: 1fr 1fr; }
    .info-cards-container { grid-template-columns: 1fr; }
    
    .select-tile { min-height: 70px; padding: 10px; }
    .select-tile i { font-size: 1.2em; }
    .footer { padding: 40px 20px; }
    .footer-content { grid-template-columns: 1fr; gap: 30px; }
}

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