/* TEDD's AI - Premium Dark Theme CSS */

:root {
    /* Color Palette - Deeper, richer background */
    --bg-primary: #030014;
    --bg-secondary: #0f0a20;
    --bg-tertiary: #1a1435;
    --bg-card: rgba(20, 15, 35, 0.6);
    --bg-card-hover: rgba(30, 25, 45, 0.8);
    --bg-glass: rgba(15, 10, 30, 0.7);

    /* Accents - Vibrants */
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-cyan: #06b6d4;
    --accent-glow: rgba(99, 102, 241, 0.5);

    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #d946ef 100%);
    --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #c026d3 100%);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    /* Status */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.3);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 3rem;
    --space-2xl: 5rem;
    --space-3xl: 8rem;

    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Setup */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Premium background mesh effect */
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.08), transparent 25%);
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 4rem;
    margin-bottom: var(--space-md);
}

h2 {
    font-size: 2.5rem;
    margin-bottom: var(--space-lg);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    font-size: 1.125rem;
}

a {
    color: inherit;
    text-decoration: none;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Layout Utilities */
.app-container {
    display: block;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.text-center {
    text-align: center;
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-md {
    gap: var(--space-md);
}

/* Navigation (Public) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-md) 0;
    transition: var(--transition);
    background: rgba(3, 0, 20, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Sidebar (Dashboard) */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
}

.logo-img {
    max-width: 100%;
    height: auto;
    max-height: 220px;
}

.sidebar-nav {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition);
    margin-bottom: var(--space-xs);
    font-size: 1rem;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-item .icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    display: block;
    margin-left: 0;
    width: 100%;
    padding: var(--space-xl);
    min-width: 0;
    box-sizing: border-box;
    transition: margin-left 0.3s ease;
}

.has-sidebar .main-content {
    margin-left: 260px !important;
    width: calc(100% - 260px) !important;
}

.page-header {
    margin-bottom: var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin: 0;
}

/* Override generic h1 for dashboard headers if needed */

/* Hero Section (Landing) */
.hero {
    position: relative;
    padding: 180px 0 100px;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: var(--space-lg);
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto var(--space-xl);
}

.hero-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* Grids */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

/* Grid System Utilities */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.col-span-1 {
    grid-column: span 1 / span 1;
}

.col-span-2 {
    grid-column: span 2 / span 2;
}

.col-span-6 {
    grid-column: span 6 / span 6;
}

.col-span-12 {
    grid-column: span 12 / span 12;
}

@media (min-width: 768px) {
    .md\:grid-cols-12 {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }

    .md\:col-span-2 {
        grid-column: span 2 / span 2;
    }

    .md\:col-span-6 {
        grid-column: span 6 / span 6;
    }
}

.gap-md {
    gap: var(--space-md);
}

.items-end {
    align-items: flex-end;
}

/* Components - Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: var(--radius-md);
}

.vehicle-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.vehicle-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.vehicle-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.vehicle-card-body {
    padding: var(--space-md);
}

.vehicle-card-title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
    font-size: 1.125rem;
    color: var(--text-primary);
}

.vehicle-card-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

/* Selection Checkbox */
.selection-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--accent-primary);
    opacity: 0.5;
    transition: var(--transition);
}

.vehicle-card:hover .selection-checkbox,
.selection-checkbox:checked {
    opacity: 1;
}

.vehicle-card.selected {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 1rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
    background: var(--accent-gradient-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.btn-danger {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.5);
}

.btn-danger:hover {
    background: rgba(220, 38, 38, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background: var(--bg-tertiary);
    border-radius: 13px;
    position: relative;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(24px);
    background: white;
}

/* Day Selector */
.day-selector {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.day-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.day-btn:hover {
    border-color: var(--accent-primary);
    color: white;
}

.day-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

/* Logs */
.logs-container {
    background: #050510;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    height: 300px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.log-line {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.posted {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-badge.discovered {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
}

.status-badge.sold {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.status-badge.failed {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* Bulk Actions */
.bulk-actions-toolbar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: #110e22;
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.2);
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bulk-actions-toolbar.visible {
    transform: translateX(-50%) translateY(0);
}

/* Stats & CTA */
.stats-section {
    padding: var(--space-3xl) 0;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    display: block;
    margin-bottom: 0.5rem;
}

.cta-section {
    padding: 100px 0;
    text-align: center;
}

.cta-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    max-width: 900px;
    margin: 0 auto;
}

/* Footer */
footer {
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero {
        padding-top: 120px;
    }

    .features-grid,
    .vehicle-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    /* Mobile Menu todo */
    .main-content {
        margin-left: 0;
        padding: var(--space-md);
    }
}

/* ==================== Status Tabs ==================== */
.status-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.status-tab {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 400;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.status-tab:hover {
    color: var(--text-secondary);
}

.status-tab.active {
    font-weight: 600;
}

.status-tab.active-all {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.status-tab.active-ready {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.status-tab.active-scheduled {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
}

.status-tab.active-posted {
    color: #10b981;
    border-bottom-color: #10b981;
}

.status-tab.active-failed {
    color: #ef4444;
    border-bottom-color: #ef4444;
}

.status-tab .count-badge {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 6px;
}

/* ==================== Status Badges ==================== */
.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
}

.status-badge-ready {
    background: #3b82f6;
}

.status-badge-scheduled {
    background: #f59e0b;
}

.status-badge-posted {
    background: #10b981;
}

.status-badge-failed {
    background: #ef4444;
}

.status-badge-default {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}