/*
 * FoodSense AI — Global Styles
 * ==============================
 * Dark scientific theme with CSS custom properties.
 */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    /* Freshness status colors */
    --fresh-color:    #28a745;
    --safe-color:     #17a2b8;
    --warning-color:  #ffc107;
    --spoiled-color:  #dc3545;

    /* Scientific UI palette */
    --primary:        #1a237e;
    --primary-light:  #3949ab;
    --secondary:      #00695c;
    --accent:         #58a6ff;
    --accent-hover:   #79b8ff;

    /* Backgrounds */
    --bg-dark:        #0d1117;
    --bg-card:        #161b22;
    --bg-nav:         #0d1117;

    /* Text */
    --text-primary:   #e6edf3;
    --text-secondary: #8b949e;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1 0 auto;
}

/* ── Font Utilities ─────────────────────────────────────────── */
.font-mono {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* ── Accent Color Utilities ─────────────────────────────────── */
.text-accent { color: var(--accent) !important; }
.bg-accent   { background-color: var(--accent) !important; }
.border-accent { border-color: var(--accent) !important; }

.btn-accent {
    background-color: var(--accent);
    color: #0d1117;
    border: none;
    font-weight: 600;
}
.btn-accent:hover {
    background-color: var(--accent-hover);
    color: #0d1117;
}
.btn-outline-accent {
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-accent:hover {
    background-color: var(--accent);
    color: #0d1117;
}

/* ── Card Styles ────────────────────────────────────────────── */
.bg-card, .card.bg-card {
    background-color: var(--bg-card) !important;
}

.card {
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    font-size: 0.875rem;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar-brand {
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.navbar .nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    transition: color 0.2s ease;
}

.navbar .nav-link:hover {
    color: var(--accent) !important;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
    background-color: var(--bg-card);
    flex-shrink: 0;
}

/* ── Hero Section ───────────────────────────────────────────── */
.hero-section {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(ellipse at top right, #58a6ff08 0%, transparent 60%);
    pointer-events: none;
}

.min-vh-75 {
    min-height: 75vh;
}

/* ── Step Numbers ───────────────────────────────────────────── */
.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #0d1117;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Feature Cards ──────────────────────────────────────────── */
.feature-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(88, 166, 255, 0.08);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: #58a6ff12;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ── Tech Badges ────────────────────────────────────────────── */
.tech-badge {
    font-size: 0.8rem;
    font-weight: 500;
    background: transparent;
    border-radius: 20px;
}

/* ── Camera & Upload ────────────────────────────────────────── */
.camera-container {
    position: relative;
    min-height: 240px;
    background: var(--bg-dark);
    border-radius: 12px;
    overflow: hidden;
}

.camera-container video {
    border-radius: 12px;
}

.camera-placeholder {
    background: var(--bg-dark);
    border: 2px dashed #30363d;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone {
    border: 2px dashed #30363d;
    background: var(--bg-dark);
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone.drag-active,
.upload-zone:hover {
    border-color: var(--accent);
    background: #58a6ff08;
}

/* ── Loading Overlay ────────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 17, 23, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-content {
    text-align: center;
}

.spinner-border.text-accent {
    color: var(--accent) !important;
    width: 3rem;
    height: 3rem;
}

/* ── Progress Bars ──────────────────────────────────────────── */
.progress {
    background-color: #21262d;
    border-radius: 6px;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #161b22;
}

/* ── Nav Pills ──────────────────────────────────────────────── */
.nav-pills .nav-link {
    color: var(--text-secondary);
    background: var(--bg-dark);
    border: 1px solid #30363d;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-pills .nav-link.active {
    background: var(--accent);
    color: #0d1117;
    border-color: var(--accent);
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.15);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-section .display-4 {
        font-size: 2rem;
    }
    .min-vh-75 {
        min-height: auto;
    }
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
