/* ============================================
   Dashboard Layout (Profile) - Motorsport Theme
   ============================================ */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 76px);
    /* Adjusted for new navbar height */
    background: var(--color-bg-primary);
}

.dashboard-sidebar {
    width: 280px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--color-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    position: sticky;
    top: 76px;
    height: calc(100vh - 76px);
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 2rem 2rem;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.sidebar-brand img {
    max-height: 50px;
}

.sidebar-user {
    padding: 2rem;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-accent-red);
    box-shadow: 0 0 15px rgba(230, 0, 0, 0.3);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--color-surface);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
}

.user-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-style: italic;
    color: var(--color-text-primary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.user-email {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.sidebar-nav {
    padding: 1rem 0;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 2rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    border-left-color: var(--color-accent-red);
}

.nav-item .icon {
    margin-right: 1rem;
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-item.logout {
    margin-top: auto;
    border-top: 1px solid var(--color-border);
    color: var(--color-error);
}

.nav-item.logout:hover {
    background: rgba(255, 23, 68, 0.1);
    border-left-color: var(--color-error);
}

/* Navigation Section Dividers */
.nav-divider {
    padding: 1rem 2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    margin-top: 1rem;
}

.nav-divider:first-child {
    margin-top: 0;
}

.dashboard-main {
    flex-grow: 1;
    padding: 3rem;
    position: relative;
    width: calc(100% - 280px);
}

/* Overlay handled by body generic background now */

.dashboard-content {
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin: 0 auto;
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 280px;
        position: fixed;
        top: 0;
        left: -280px;
        bottom: 0;
        height: 100vh;
        z-index: 1050;
        border-right: 1px solid var(--color-border);
        transition: left var(--transition-normal);
        background: #000;
        /* Ensure background is opaque */
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    .dashboard-sidebar.mobile-open {
        left: 0;
    }

    /* Add overlay when sidebar is open */
    .dashboard-sidebar.mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 280px;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        width: 100vw;
    }

    .sidebar-header,
    .sidebar-user {
        display: block;
        /* Show headers in mobile menu */
    }

    .sidebar-nav {
        flex-direction: column;
        overflow-y: auto;
    }

    .nav-item {
        padding: 0.75rem 2rem;
        border-left: 3px solid transparent;
        border-bottom: none;
        white-space: normal;
    }

    .nav-item:hover,
    .nav-item.active {
        border-left-color: var(--color-accent-red);
        background: rgba(255, 255, 255, 0.05);
    }

    .dashboard-main {
        width: 100%;
        padding: 1.5rem;
    }
}

/* ============================================
   Vehicle Cards (Carbon Style)
   ============================================ */
.vehicle-card {
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
}

.vehicle-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(45deg,
            rgba(0, 0, 0, 0.05),
            rgba(0, 0, 0, 0.05) 2px,
            transparent 2px,
            transparent 4px);
    pointer-events: none;
    z-index: 0;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-accent-red);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.vehicle-img-container {
    width: 100%;
    height: 200px;
    background: #000;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.vehicle-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.vehicle-card:hover .vehicle-img {
    transform: scale(1.05);
}

.vehicle-info {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.vehicle-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-family: var(--font-heading);
    font-style: italic;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.vehicle-detail-row {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}

.detail-label {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.detail-value {
    color: var(--color-text-primary);
    font-weight: 600;
}

.vehicle-actions {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.2);
}

.btn-register {
    background-color: var(--color-success);
    color: #000;
    border: none;
    flex-grow: 1;
    font-weight: bold;
    text-transform: uppercase;
}

.btn-register:hover {
    background-color: #00c853;
    color: #000;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

.btn-edit-vehicle {
    background-color: var(--color-border);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-light);
}

.btn-edit-vehicle:hover {
    background-color: var(--color-surface-hover);
    border-color: var(--color-text-primary);
}

.btn-disabled {
    background-color: var(--color-surface);
    color: var(--color-text-muted);
    cursor: not-allowed;
    border: 1px solid var(--color-border);
    opacity: 0.6;
}