/* 
  StadiumBites v4 - Neon Glass AI Dashboard
*/

:root {
    /* Color Palette */
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 25, 0.6);
    --card-border: rgba(255, 255, 255, 0.05);
    --accent-primary: #00f0ff; /* Neon Cyan */
    --accent-secondary: #ff0055; /* Neon Pink */
    --ai-purple: #8b5cf6;
    --ai-glow: rgba(139, 92, 246, 0.5);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    
    /* Semantic Colors */
    --star-color: #fbbf24;
    --shield-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Typography */
    --font-main: 'Outfit', sans-serif;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(139, 92, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 90%, rgba(0, 240, 255, 0.1), transparent 25%);
    background-attachment: fixed;
}

/* --- Navigation --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.logo i {
    color: var(--ai-purple);
    transition: transform 0.3s ease;
}

.logo:hover i {
    transform: scale(1.05);
}

.ai-badge {
    background: linear-gradient(90deg, var(--ai-purple), var(--accent-primary));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 1px;
    vertical-align: top;
    margin-left: 5px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ai-badge:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-secondary);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-secondary);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(255, 0, 85, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 0, 85, 0); }
}

/* --- Main Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
}

/* --- Stadium Brain Dashboard --- */
.stadium-brain-section {
    background: linear-gradient(145deg, rgba(20,20,25,0.9), rgba(10,10,12,0.9));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.1);
}

.stadium-brain-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ai-purple), var(--accent-primary), transparent);
}

.brain-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ai-purple);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.glowing-icon {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 5px var(--ai-purple), 0 0 10px var(--ai-purple); }
    to { text-shadow: 0 0 10px var(--ai-purple), 0 0 20px var(--ai-purple); }
}

.brain-content {
    position: relative;
}

#global-insight-text {
    font-size: 1.1rem;
    line-height: 1.5;
    color: #e2e8f0;
    font-weight: 300;
}

.scanline {
    position: absolute;
    top: -20px; left: -20px; right: -20px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, rgba(0, 240, 255, 0.1), transparent);
    animation: scan 4s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(150px); }
}

/* --- Trending Grid --- */
.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Compact Cards */
.food-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.food-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 255, 0.15);
}

.card-image-container {
    position: relative;
    height: 160px;
}

.food-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-image-container::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(20,20,25,1), transparent);
}

.freshness-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.food-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-top: -20px; /* Pull up into gradient */
    z-index: 2;
    position: relative;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.2rem;
}

.food-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.wait-time-badge {
    background: rgba(0, 0, 0, 0.8);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.text-success { color: var(--success-color); border: 1px solid rgba(16, 185, 129, 0.3); }
.text-warning { color: var(--warning-color); border: 1px solid rgba(245, 158, 11, 0.3); }
.text-danger { color: var(--danger-color); border: 1px solid rgba(239, 68, 68, 0.3); }

.food-vendor {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.food-rating-metrics {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.metric {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.star-color { color: var(--star-color); }
.shield-color { color: var(--shield-color); }

.rate-btn {
    width: 100%;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    padding: 0.5rem;
    border-radius: 8px;
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.food-card:hover .rate-btn {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}


/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-color);
    border: 1px solid rgba(0, 240, 255, 0.3);
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    position: relative;
    transform: scale(0.95);
    transition: var(--transition);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.modal-header { padding: 1.5rem 1.5rem 0; }
.modal-header img { display: none; } /* Hide img in modal for sleeker look */
.modal-header h3 { font-size: 1.5rem; margin-bottom: 0.2rem; }
.modal-header p { color: var(--text-muted); }

.modal-body { padding: 1.5rem; }

.rating-input-section {
    margin-bottom: 1.5rem;
}

.rating-input-section h4 {
    margin-bottom: 0.8rem;
    color: #e2e8f0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stars-container { display: flex; gap: 0.8rem; }

.star-rate {
    font-size: 1.8rem;
    color: var(--card-border);
    cursor: pointer;
    transition: var(--transition);
}

.star-rate.hovered, .star-rate.selected {
    color: var(--star-color);
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.shield-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.shield-icon {
    font-size: 1.8rem;
    color: var(--card-border);
    transition: color 0.3s ease;
}

.hygiene-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--card-border);
    border-radius: 3px;
    outline: none;
}

.hygiene-slider::-webkit-slider-thumb {
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--shield-color);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background: var(--accent-primary);
    color: #000;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:disabled {
    background: var(--card-border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.submit-btn:not(:disabled):hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

/* --- Floating Action Button & Chat Panel --- */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 900;
}

.ai-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ai-purple);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

.ai-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.8);
}

.chat-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 400px;
    background: rgba(15, 15, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    z-index: 899;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

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

.chat-header h3 {
    font-size: 1rem;
    color: var(--ai-purple);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-header button {
    background: none; border: none; color: white; cursor: pointer;
}

.chat-body {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    padding: 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 85%;
}

.chat-message.bot {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-message.user {
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid rgba(0, 240, 255, 0.3);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

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

.chat-input-area input {
    flex-grow: 1;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--card-border);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    font-family: var(--font-main);
    outline: none;
}

.chat-input-area input:focus {
    border-color: var(--ai-purple);
}

.chat-input-area button {
    background: var(--ai-purple);
    color: white;
    border: none;
    width: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.chat-input-area button:hover {
    background: #7c3aed;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent-primary);
    color: #000;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: 700;
    opacity: 0;
    transition: var(--transition);
    z-index: 2000;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
