@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #FFFDF9;
    --bg-card: #FFFFFF;
    --bg-surface: #FFF9F3;
    --primary: #FF6B35;
    --primary-hover: #E05624;
    --primary-light: #FFEDE5;
    --accent-green: #4E9F3D;
    --accent-green-light: #E8F5E9;
    --text-dark: #2D2520;
    --text-muted: #706863;
    --border-color: #EFE8E2;
    --shadow-soft: 0 8px 30px rgba(255, 107, 53, 0.06);
    --shadow-medium: 0 12px 40px rgba(255, 107, 53, 0.12);
    --shadow-glass: 0 8px 32px 0 rgba(255, 107, 53, 0.08);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --font-main: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Header & Navigation */
header {
    background-color: rgba(255, 253, 249, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.25rem 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.logo span.accent {
    color: var(--accent-green);
}

.logo:hover {
    transform: scale(1.03);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-history {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
}

.btn-history:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.badge {
    background-color: var(--primary);
    color: white;
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-weight: 700;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem 2rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero h1 span.highlight {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.hero h1 span.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: var(--primary-light);
    z-index: -1;
    border-radius: 4px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem auto;
}

/* Dashboard & Main Grid */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 5rem 2rem;
    width: 100%;
    flex: 1;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2.5rem;
}

@media (max-width: 992px) {
    main {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
}

/* Premium Card Panels */
.card-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.card-panel:hover {
    box-shadow: var(--shadow-medium);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

/* Budget Slider */
.slider-container {
    position: relative;
    padding: 0.5rem 0;
}

.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
    transition: var(--transition-smooth);
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.4);
    transition: var(--transition-smooth);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--primary-hover);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.slider-labels span.active {
    color: var(--primary);
    font-weight: 700;
}

/* Grid selectors */
.cuisine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.chip-btn {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    color: var(--text-dark);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
    user-select: none;
}

.chip-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.chip-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

/* Option selections (meal, mood, time, diet) */
.options-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.time-btn {
    flex: 1;
    min-width: 80px;
}

/* Surprise Me Switch */
.toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    margin-bottom: 2rem;
}

.toggle-info {
    display: flex;
    flex-direction: column;
}

.toggle-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.toggle-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 34px;
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

input:checked + .slider-toggle {
    background-color: var(--accent-green);
}

input:checked + .slider-toggle:before {
    transform: translateX(24px);
}

/* Recommend Button */
.btn-recommend {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.btn-recommend:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.btn-recommend:active {
    transform: translateY(0);
}

/* Right Panel: Wheel & Result */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Roulette Spinner - COLORFUL AND FUN UPDATED */
.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.roulette-wrapper {
    position: relative;
    width: 290px;
    height: 290px;
    margin: 1.5rem 0;
}

.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 28px solid #FF3B30;
    z-index: 10;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.25));
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 10px solid #FFEDD5;
    position: relative;
    overflow: hidden;
    transition: transform 4s cubic-bezier(0.1, 0.8, 0.1, 1);
    box-shadow: 0 15px 35px rgba(255, 107, 53, 0.2);
}

/* Fun colorful gradients */
.wheel-inner {
    width: 100%;
    height: 100%;
    position: relative;
    background: conic-gradient(
        #FF7A5A 0deg 45deg,
        #FF5A5F 45deg 90deg,
        #FFB800 90deg 135deg,
        #00D084 135deg 180deg,
        #06B6D4 180deg 225deg,
        #8B5CF6 225deg 270deg,
        #EC4899 270deg 315deg,
        #F59E0B 315deg 360deg
    );
}

.wheel-label {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: bottom right;
    top: 0;
    left: 0;
    padding: 15px;
    font-weight: 800;
    font-size: 0.8rem;
    color: white;
    text-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.wheel-label:nth-child(1) { transform: rotate(22.5deg); }
.wheel-label:nth-child(2) { transform: rotate(67.5deg); }
.wheel-label:nth-child(3) { transform: rotate(112.5deg); }
.wheel-label:nth-child(4) { transform: rotate(157.5deg); }
.wheel-label:nth-child(5) { transform: rotate(202.5deg); }
.wheel-label:nth-child(6) { transform: rotate(247.5deg); }
.wheel-label:nth-child(7) { transform: rotate(292.5deg); }
.wheel-label:nth-child(8) { transform: rotate(337.5deg); }

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    background: #FFFFFF;
    border: 5px solid #FF6B35;
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    cursor: pointer;
    font-size: 0.95rem;
    color: #FF6B35;
    user-select: none;
    transition: var(--transition-smooth);
}

.wheel-center:hover {
    transform: translate(-50%, -50%) scale(1.15);
    background: #FFF5F0;
    color: #E05624;
}

/* Result Section styling */
.result-card {
    display: none;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.result-card.active {
    display: block;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.result-cuisine {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-save-fav {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-save-fav:hover {
    color: #FF3B30;
    transform: scale(1.15);
}

.btn-save-fav.active {
    color: #FF3B30;
}

.result-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.result-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.result-details {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-action-outline {
    width: 100%;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    color: var(--text-dark);
    padding: 0.8rem;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-action-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-ai-recipe {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8E53 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
}

.btn-ai-recipe:hover {
    background: linear-gradient(135deg, #E05624 0%, #FF6B35 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
}

/* Nearby Spotlights styling */
.restaurant-card-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.restaurant-card-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.rest-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rest-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.rest-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-rest-link {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.btn-rest-link:hover {
    background: var(--primary);
    color: white;
}

/* History / Favorites Off-canvas Drawer */
.history-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--bg-card);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    z-index: 200;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.history-drawer.open {
    right: 0;
}

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-close-drawer {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.btn-close-drawer:hover {
    color: var(--text-dark);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.fav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    transition: var(--transition-smooth);
}

.fav-item:hover {
    border-color: var(--primary);
    background: var(--bg-surface);
}

.fav-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fav-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.fav-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-delete-fav {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.btn-delete-fav:hover {
    color: #FF3B30;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
}

.empty-state p {
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* Backdrop */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(45, 37, 32, 0.4);
    backdrop-filter: blur(4px);
    z-index: 150;
    display: none;
}

.drawer-backdrop.open {
    display: block;
}

/* Floating AI Chat Genie */
.ai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 120;
}

.ai-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B35 0%, #FF9E79 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    transition: var(--transition-smooth);
}

.ai-chat-btn:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 12px 30px rgba(255, 107, 53, 0.45);
}

.ai-chat-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(45, 37, 32, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.ai-chat-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ai-chat-header {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8353 100%);
    color: white;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-title {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #FAF8F5;
}

.chat-bubble {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-bubble.assistant {
    background: white;
    color: var(--text-dark);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.chat-bubble.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    background: white;
}

.chat-input {
    flex: 1;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.8rem;
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.chat-input:focus {
    border-color: var(--primary);
}

.btn-send-chat {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-send-chat:hover {
    background: var(--primary-hover);
}

/* Footer styling */
footer {
    text-align: center;
    padding: 3rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-card);
    margin-top: auto;
}

footer p a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
