html, body { height: 100%; margin: 0; }
/* demo-app.css - 2026 Vibrant Edition */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    /* ADMIN PREMIUM SAAS COLORS - SOPHISTICATED */
    --admin-bg: #0a0f1d; /* Premium Deep Indigo */
    --admin-sidebar: #0f1525; 
    --admin-panel: #141b2d;
    --admin-text: #f8fafc;
    --admin-accent: #e65c00; /* Controlled Premium Orange */
    --admin-accent-glow: rgba(230, 92, 0, 0.4); /* Softer Glow */
    --admin-secondary: #3b82f6; /* Classic SaaS Blue */
    --admin-border: rgba(255, 255, 255, 0.06);
    
    /* FRONTEND COLORS */
    --front-bg: #f8fafc;
    --front-surface: #ffffff;
    --front-text: #1e293b;
    --front-accent: #f97316;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: transparent;
    overflow-x: hidden;
}

/* STATE MANAGEMENT */
.view-state {
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

.view-state.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

/* =========================================
   ADMIN DASHBOARD (2026 NEXT LEVEL)
========================================= */
#admin-view {
    background: var(--admin-bg);
    color: var(--admin-text);
}

.admin-topbar {
    height: 70px;
    background: var(--admin-sidebar);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 50;
    position: relative;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 0.5px;
}

.admin-logo svg {
    color: var(--admin-accent);
    filter: drop-shadow(0 0 8px var(--admin-accent-glow));
}

.switch-btn {
    background: transparent;
    color: var(--admin-text);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
}

.switch-btn.outline {
    background: transparent;
    border: 1px solid var(--front-accent);
    color: var(--front-accent);
}
.switch-btn.outline:hover {
    background: var(--front-accent);
    color: #fff;
}

.admin-body {
    display: flex;
    flex: 1;
    height: calc(100vh - 70px);
    overflow: hidden;
}

.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar);
    border-right: 1px solid var(--admin-border);
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li {
    padding: 16px 2rem;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.admin-sidebar li:hover {
    color: #fff;
    background: rgba(255,255,255,0.03);
}

.admin-sidebar li.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(59,130,246,0.15) 0%, transparent 100%);
}

.admin-sidebar li.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--admin-secondary);
    box-shadow: 0 0 15px var(--admin-secondary);
}

.admin-sidebar li.active svg {
    color: var(--admin-secondary);
}

.admin-content {
    flex: 1;
    position: relative;
    overflow: hidden !important;
    height: 100%;
}

.admin-panel {
    display: none;
    flex-direction: column;
    height: 100%;
}
.admin-panel.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* BESTAND (Top Half) */
.inventory-section {
    padding: 2rem 3rem;
    border-bottom: 1px solid var(--admin-border);
    background: radial-gradient(circle at top right, rgba(59,130,246,0.05), transparent 50%);
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.inventory-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.inventory-search {
    display: flex;
    gap: 1rem;
}

.inventory-search input {
    background: var(--admin-panel);
    border: 1px solid var(--admin-border);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    width: 300px;
    opacity: 0.5;
    cursor: not-allowed;
}

.inventory-search select {
    background: var(--admin-panel);
    border: 1px solid var(--admin-border);
    color: #94a3b8;
    padding: 10px 16px;
    border-radius: 8px;
    opacity: 0.5;
    cursor: not-allowed;
}

.inventory-dummy-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.dummy-row {
    background: var(--admin-sidebar);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}
.dummy-row:hover {
    border-color: rgba(255,255,255,0.2);
}

.dummy-row img {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.dummy-row div {
    flex: 1;
    font-size: 0.9rem;
}
.dummy-row div strong {
    color: #fff;
}
.dummy-row div span {
    color: #64748b;
    font-size: 0.8rem;
}

.badge-online {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* INSERT FORM (Bottom Half) */
.insert-section {
    padding: 1.5rem 3rem 1rem 3rem;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMSIgY3k9IjEiIHI9IjEiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4wMykiLz48L3N2Zz4=');
}

.insert-card {
    background: var(--admin-sidebar);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 740px;
    margin: 0 auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

/* Glow Effect inside card */
.insert-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: var(--admin-accent);
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
}

.insert-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 2.5rem;
}

.icon-pulse {
    width: 50px;
    height: 50px;
    background: rgba(249, 115, 22, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-accent);
    position: relative;
}
.icon-pulse::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 16px;
    border: 2px solid var(--admin-accent);
    opacity: 0;
    animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1.2); opacity: 0; }
}

.insert-header h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}
.insert-header p {
    color: #94a3b8;
    font-size: 0.95rem;
}

.admin-form label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.form-group {
    flex: 1;
}
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s;
}
input[type="text"]:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

.image-selector {
    display: flex;
    gap: 15px;
}
.image-option {
    width: 160px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    opacity: 0.5;
    position: relative;
}
.image-option::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0.3;
    transition: 0.2s;
}
.image-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-option:hover {
    opacity: 0.8;
}
.image-option:hover::after {
    opacity: 0;
}
.image-option.selected {
    border-color: var(--admin-accent);
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.image-option.selected::after {
    opacity: 0;
}

.form-actions {
    margin-top: 3rem;
    display: flex;
    justify-content: flex-end;
}

.neon-glow {
    background: var(--admin-accent);
    color: #fff;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}
.neon-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.6);
    background: #ea580c;
}

/* DUMMY PANELS (CRM & Einstellungen) */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #94a3b8;
}
.empty-state svg {
    color: #334155;
    margin-bottom: 1.5rem;
}
.empty-state h2 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
.badge-neutral {
    background: rgba(255,255,255,0.1);
    color: #cbd5e1;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    margin-top: 2rem;
}

.settings-card {
    background: var(--admin-sidebar);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 3rem;
    max-width: 800px;
    margin: 3rem auto;
}
.settings-card h2 { color: #fff; margin-bottom: 0.5rem;}
.settings-card > p { color: #94a3b8; margin-bottom: 3rem; }

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.setting-row strong { color: #e2e8f0; font-size: 1.1rem;}
.setting-row p { color: #64748b; font-size: 0.9rem; margin-top: 5px;}

.toggle {
    width: 50px;
    height: 26px;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
}
.toggle::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle.active {
    background: var(--admin-secondary);
}
.toggle.active::after {
    transform: translateX(24px);
}


/* =========================================
   FRONTEND SHOWROOM (Live Ansicht)
========================================= */
#frontend-view {
    background: var(--front-bg);
    color: var(--front-text);
}

.frontend-topbar {
    height: 80px;
    background: var(--front-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    z-index: 10;
}

.frontend-logo .logo-text {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.frontend-logo .highlight {
    color: var(--front-accent);
}

.frontend-nav {
    display: flex;
    gap: 2.5rem;
}
.frontend-nav a {
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.2s;
}
.frontend-nav a:hover, .frontend-nav a.active {
    color: #0f172a;
}

.frontend-hero {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.frontend-hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: var(--front-accent);
    filter: blur(150px);
    opacity: 0.2;
}

.frontend-hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}
.frontend-hero p {
    color: #94a3b8;
    font-size: 1.2rem;
}

.frontend-body {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 4rem 2rem;
    gap: 4rem;
}

.frontend-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.filter-box {
    background: var(--front-surface);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 2rem;
}

.filter-box h3 {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: #0f172a;
    font-weight: 800;
}

.filter-group {
    margin-bottom: 2rem;
}
.filter-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.filter-group select {
    width: 100%;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}
.filter-group select:focus {
    border-color: var(--front-accent);
    outline: none;
}

.filter-group input[type="range"] {
    width: 100%;
    margin-top: 10px;
    accent-color: var(--front-accent);
    cursor: pointer;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 8px;
    font-weight: 500;
}

.filter-btn {
    width: 100%;
    padding: 14px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.filter-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.frontend-content {
    flex: 1;
}

.showroom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.showroom-controls span {
    font-size: 1.1rem;
    color: #475569;
}
.showroom-controls strong {
    color: #0f172a;
    font-weight: 800;
}

.showroom-controls select {
    padding: 10px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
}

.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.car-card {
    background: var(--front-surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid #f1f5f9;
}

.car-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: #e2e8f0;
}

.car-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f8fafc;
}

.car-info {
    padding: 2rem;
}

.car-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
}

.car-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.car-ps {
    background: #f1f5f9;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
}

.car-price {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--front-accent);
}

.no-results {
    text-align: center;
    padding: 4rem;
    background: #fff;
    border-radius: 16px;
    color: #64748b;
    font-size: 1.1rem;
    border: 1px dashed #cbd5e1;
}

/* =========================================
   MODAL (POP-UP)
========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: #fff;
    width: 95%;
    max-width: 1000px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(0,0,0,0.05);
    border: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center; justify-content: center;
    z-index: 10;
    transition: 0.2s;
    color: #0f172a;
}
.modal-close:hover {
    background: rgba(0,0,0,0.1);
}

.modal-layout {
    display: flex;
}
.modal-image-container {
    flex: 1.2;
    background: #f8fafc;
    display: flex; align-items: center; justify-content: center;
}
.modal-image-container img {
    width: 100%; height: 100%; object-fit: cover;
}

.modal-info-container {
    flex: 1;
    padding: 3.5rem;
}
.modal-info-container h2 {
    font-size: 2.2rem; font-weight: 900; color: #0f172a; margin-bottom: 0.5rem;
}
.modal-price {
    font-size: 2rem; font-weight: 900; color: var(--front-accent); margin-bottom: 2.5rem;
}
.modal-specs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
    margin-bottom: 2.5rem; padding-bottom: 2.5rem; border-bottom: 2px solid #f1f5f9;
}
.spec-item { display: flex; flex-direction: column; }
.spec-label { font-size: 0.85rem; text-transform: uppercase; color: #64748b; font-weight: 700; margin-bottom: 5px; }
.spec-item strong { color: #0f172a; font-size: 1.1rem; }
.modal-description h3 { font-size: 1.1rem; margin-bottom: 0.8rem; color: #0f172a; font-weight: 800;}
.modal-description p { font-size: 1rem; line-height: 1.6; color: #475569; margin-bottom: 2.5rem;}
.btn-primary {
    background: var(--front-accent); color: #fff; border: none; padding: 18px 24px;
    font-size: 1.1rem; font-weight: 800; border-radius: 12px; cursor: pointer; transition: 0.2s;
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.2);
}
.btn-primary.full-width { width: 100%; }
.btn-primary:hover { background: #ea580c; transform: translateY(-2px); box-shadow: 0 15px 25px rgba(249, 115, 22, 0.3); }

.ai-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 0.55rem;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    z-index: 10;
    font-weight: 700;
    letter-spacing: 0.5px;
    pointer-events: none;
}
.image-option {
    position: relative;
}


/* ==========================================================================
   MOBILE OPTIMIZATION (Injected by Antigravity)
   ========================================================================== */
@media (max-width: 900px) {
    /* Admin Dashboard */
    .admin-body {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
    }
    
    .admin-sidebar {
        width: 100% !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding: 1rem !important;
    }

    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .admin-nav a {
        flex: 1 1 calc(50% - 0.5rem);
        text-align: center;
        justify-content: center;
        padding: 0.8rem !important;
    }
    
    .admin-content {
        padding: 1rem !important;
        overflow-y: visible !important;
    }
    
    /* Insert/Edit Form in Dashboard */
    .insert-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Frontend Showroom */
    .frontend-body {
        flex-direction: column !important;
    }
    
    .frontend-sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
        position: relative !important;
        top: 0 !important;
        height: auto !important;
    }
    
    .frontend-content {
        padding: 1rem !important;
    }
    
    .car-grid {
        grid-template-columns: 1fr !important;
    }

    /* Modal */
    .modal-layout {
        flex-direction: column !important;
    }
    .modal-info-container {
        padding: 1.5rem !important;
    }
}
