:root {
    --bg-dark: #0A0A0B;
    --bg-sidebar: #111113;
    --bg-card: #18181B;
    --primary: #CC0000;
    --primary-hover: #A30000;
    --text-main: #FFFFFF;
    --text-muted: #A0A0A5;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --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-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    display: flex;
    min-height: 100vh;
}

.admin-container {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 0 2rem;
    margin-bottom: 3rem;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-header span {
    color: var(--primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 1rem 1.5rem;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.nav-btn:hover, .nav-btn.active {
    background: var(--glass);
    color: var(--text-main);
}

.nav-btn.active {
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    margin-top: auto;
    padding: 0 2rem;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 3rem;
    max-width: 1200px;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#mobile-menu-toggle {
    display: none;
}

.main-header h1 {
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cards */
.card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin-bottom: 2rem;
}

.glass {
    backdrop-filter: blur(10px);
}

h3 {
    margin-bottom: 2rem;
    font-size: 1.2rem;
    color: var(--primary);
    text-transform: uppercase;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input, textarea, select {
    width: 100%;
    background: #111113;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 1rem;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

input:focus, textarea:focus {
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

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

.btn-danger {
    background: transparent;
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #ff4444;
    color: white;
}

/* Inventory Table */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.car-thumb {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.section-actions {
    margin-bottom: 2rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    min-width: 600px;
}

/* Sections */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 3rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Services Grid Admin */
.services-grid-admin {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.service-card-admin {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.icon-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.icon-selector i {
    font-size: 2rem;
    color: var(--primary);
    width: 50px;
}

/* Icon Picker */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 2rem;
}

.icon-item {
    font-size: 1.5rem;
    padding: 1rem;
    background: var(--glass);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-item:hover {
    background: var(--primary);
}

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

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.accessory-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-list-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 1rem;
    background: #111113;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    min-height: 50px;
}

.admin-list-item {
    background: var(--glass);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--glass-border);
}

.admin-list-item button {
    background: transparent;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 0.8rem;
}

.image-preview-box {
    margin-top: 1rem;
    width: 100%;
    max-height: 200px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-preview-box img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.gallery-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #111113;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    min-height: 100px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .remove-img {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(204, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.gallery-item .remove-img:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* Responsive design */
@media (max-width: 992px) {
    .sidebar {
        left: -250px;
        z-index: 3000;
        transition: left 0.3s ease;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 2rem 1.5rem;
    }

    #mobile-menu-toggle {
        display: flex;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.7);
        z-index: 2999;
        backdrop-filter: blur(4px);
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .services-grid-admin {
        grid-template-columns: 1fr;
    }
    
    .main-header h1 {
        font-size: 1.4rem;
    }
}
