/*
 * Sidebar Component Styles
 * Extracted from app/views/layouts/sidebar.php
 *
 * Navigation rail layout, badges, mobile drawer styles.
 */

/* Sidebar Layout Fix */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Default align-items: stretch or center? Let's check parent */
    width: 100%;
    align-items: center;
    overflow-y: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;

    /* IMPORTANT: Start from top, not center */
    justify-content: flex-start;
}

/* Pushes subsequent items to bottom */
.nav-spacer {
    flex: 1;
    min-height: 1rem;
    /* Minimum gap */
}

/* Badge tweaks */
.nav-item {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1px solid white;
}

.logout-btn {
    color: var(--accent-red, #ef4444) !important;
}

.logout-btn:hover {
    background: #fef2f2 !important;
}

.nav-label {
    display: none;
}

/* Hide labels on desktop sidebar */

/* Mobile sidebar styles */
@media (max-width: 640px) {
    .sidebar .nav-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 0.875rem 1rem;
        border-radius: 12px;
        height: auto;
        /* Reset desktop hover effects */
        transform: none !important;
        background: transparent;
        transition: background 0.15s ease;
    }

    .sidebar .nav-item:hover {
        transform: none !important;
        background: rgba(99, 102, 241, 0.06);
    }

    .sidebar .nav-item:active {
        background: rgba(99, 102, 241, 0.12);
    }

    .sidebar .nav-item ion-icon {
        font-size: 1.3rem;
        flex-shrink: 0;
        width: 24px;
        color: inherit;
    }

    .sidebar .nav-item .nav-label {
        display: block;
        font-size: 0.95rem;
        font-weight: 500;
        flex: 1;
        color: var(--primary, #1e293b);
        opacity: 1;
    }

    .sidebar .nav-item.active {
        background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    }

    .sidebar .nav-item.active .nav-label {
        color: var(--primary, #4f46e5);
        font-weight: 600;
    }

    .sidebar .nav-item.active ion-icon {
        color: var(--primary, #4f46e5);
    }

    .nav-badge {
        position: static;
        margin-left: auto;
        border: none;
    }

    .nav-spacer {
        display: none;
    }

    /* Logout button special styling */
    .sidebar .nav-item.logout-btn .nav-label {
        color: #ef4444;
    }

    .sidebar .nav-item.logout-btn:hover {
        background: #fef2f2;
    }
}
