/* App Layout Styles */
.sidebar {
    width: 250px;
    min-height: 100vh;
    transition: width 0.3s ease;
    flex-shrink: 0; /* Prevent sidebar from shrinking when main content is wide */
}

.main-content {
    min-height: 100vh;
    padding-bottom: 80px; /* Space for mobile nav */
    min-width: 0; /* Allow main content to shrink if needed */
    overflow-x: auto; /* Handle horizontal overflow gracefully */
}

/* Tablet view - icon only sidebar */
@media (max-width: 991.98px) and (min-width: 768px) {
    .sidebar {
        width: 92px;
        flex-shrink: 0; /* Prevent sidebar from shrinking on tablet too */
    }
    
    .sidebar .nav-link span {
        display: none;
    }
    
    .sidebar .dropdown-toggle {
        padding: 0.5rem;
    }
    
    .sidebar .dropdown-toggle span {
        display: none;
    }
}

/* Mobile navigation */
.mobile-nav {
    z-index: 1030;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
    .main-content {
        padding-bottom: 0;
    }
}

/* Navigation active states */
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.mobile-nav .btn.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown improvements */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Icon spacing */
.nav-link .bi {
    width: 1.75rem;
    height: 1.75rem;
}

/* Mobile nav button styling */
.mobile-nav .btn {
    flex-direction: column;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    border: none;
    text-decoration: none;
}

.mobile-nav .btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-nav .btn .bi {
    width: 1.75rem;
    height: 1.75rem;
}

.mobile-nav small {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Breadcrumb Styling Improvements */
.breadcrumb {
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.breadcrumb-item {
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "→";
    color: var(--bs-secondary-color);
    font-weight: normal;
    margin: 0 0.5rem;
}

.breadcrumb-item a {
    color: var(--bs-link-color);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.breadcrumb-item a:hover {
    color: var(--bs-link-hover-color);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--bs-emphasis-color);
    font-weight: 600;
}

/* Mobile breadcrumb adjustments */
@media (max-width: 767.98px) {
    .breadcrumb {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        margin-bottom: 1rem;
    }
    
    .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 0.25rem;
    }
}

/* HTMX Loading Indicators */
.htmx-indicator {
    display: none;
}

/* Display this element when it or a parent has an outstanding request */
.htmx-request .htmx-indicator {
    display: block;
}

.htmx-request.htmx-indicator {
    display: block;
}

/* Hide this element when it or a parent has an outstanding request */
.htmx-request .htmx-hide-swap {
    display: none;
}

.htmx-request.htmx-hide-swap {
    display: none;
}

/* Button loading states - make text invisible but keep layout, show spinner overlay */
.htmx-request .indicator-button {
    opacity: 0;
}

.spinner-border-btn {
    --bs-spinner-width: 1.15em;
    --bs-spinner-height: 1.15em;
    --bs-spinner-border-width: 0.1em;
    --bs-spinner-vertical-align: -0.25em;
}

/* Difficulty Level Styles */
/* Based on mastery levels: mastered > 0.05, known > 0.15, familiar > 0.25, learning > 0.35, new everything else */

.difficulty-mastered {
    color: #198754 !important; /* Bootstrap success dark green */
}

.difficulty-known {
    color: #20c997 !important; /* Bootstrap info teal/light green */
}

.difficulty-familiar {
    color: #ffc107 !important; /* Bootstrap warning yellow */
}

.difficulty-learning {
    color: #fd7e14 !important; /* Bootstrap orange */
}

.difficulty-new {
    color: #dc3545 !important; /* Bootstrap danger red */
}

/* Background versions for badges, progress bars, etc. */
.bg-difficulty-mastered {
    background-color: #198754 !important;
}

.bg-difficulty-known {
    background-color: #20c997 !important;
}

.bg-difficulty-familiar {
    background-color: #ffc107 !important;
}

.bg-difficulty-learning {
    background-color: #fd7e14 !important;
}

.bg-difficulty-new {
    background-color: #dc3545 !important;
}