:root {
    --primary-green: #2E7D32;
    --secondary-green: #4CAF50;
    --light-green: #E8F5E9;
    --text-dark: #1B5E20;
    --sidebar-width: 320px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    overflow-x: hidden;
}

#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--light-green);
    color: var(--text-dark);
    transition: all 0.3s;
    border-right: 1px solid #c8e6c9;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

#sidebar-content {
    overflow-y: auto;
    flex-grow: 1;
}

/* Custom Scrollbar for Sidebar */
#sidebar-content::-webkit-scrollbar {
    width: 6px;
}
#sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}
#sidebar-content::-webkit-scrollbar-thumb {
    background-color: rgba(46, 125, 50, 0.3);
    border-radius: 3px;
}

#sidebar.active {
    margin-left: calc(var(--sidebar-width) * -1);
}

#sidebar .sidebar-header {
    padding: 22px 20px 20px 20px;
    background: var(--primary-green);
    color: #fff;
    flex-shrink: 0;
}

#sidebar ul.components {
    padding: 20px 0;
    border-bottom: none;
}

#sidebar ul p {
    color: #fff;
    padding: 10px;
}

#sidebar ul li a {
    padding: 10px 20px;
    font-size: 1.1em;
    display: block;
    color: var(--text-dark);
    text-decoration: none;
    transition: 0.2s;
}

#sidebar ul li a:hover {
    color: var(--primary-green);
    background: #fff;
}

/* Highlight chevron when main link is hovered */
#sidebar ul li a:hover + a {
    color: var(--primary-green);
    background: #fff;
}

#sidebar ul li.active > a,
#sidebar ul div.active > a {
    color: var(--primary-green);
    background: #fff;
    font-weight: bold;
}

a[aria-expanded="true"] {
    color: var(--primary-green);
    font-weight: bold;
}

a[data-toggle="collapse"] {
    position: relative;
}

/* Removed .dropdown-toggle::after as we use custom icons now */

ul ul a {
    font-size: 0.9em !important;
    padding-left: 30px !important;
    background: rgba(255, 255, 255, 0.3);
}

ul ul ul a {
    padding-left: 50px !important;
    background: rgba(255, 255, 255, 0.5);
}

#content {
    width: 100%;
    padding: 20px;
    min-height: 100vh;
    transition: all 0.3s;
}

.navbar {
    padding: 15px 10px;
    background: #fff;
    border: none;
    border-radius: 0;
    margin-bottom: 40px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.navbar-btn {
    box-shadow: none;
    outline: none !important;
    border: none;
}

.line {
    width: 100%;
    height: 1px;
    border-bottom: 1px dashed #ddd;
    margin: 40px 0;
}

/* Content Styling */
.content-header {
    color: var(--primary-green);
    border-bottom: 2px solid var(--secondary-green);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    margin-bottom: 20px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 991px) {
    #sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
    }
    #sidebar.active {
        margin-left: 0;
    }
    #sidebarCollapse span {
        display: none;
    }
}

/* Mobile Sidebar Overlay */
.overlay {
    display: none;
    position: fixed;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: all 0.5s ease-in-out;
}

.overlay.active {
    display: block;
    opacity: 1;
}

#dismiss {
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    background: #2E7D32; /* primary-green */
    color: #fff;
    position: absolute;
    top: 20px; /* Adjusted to align with header text */
    right: 15px;
    cursor: pointer;
    -webkit-transition: all 0.3s;
    -o-transition: all 0.3s;
    transition: all 0.3s;
    border-radius: 5px;
    z-index: 1001;
    display: block; /* Always visible */
}

#dismiss:hover {
    background: #fff;
    color: #2E7D32;
}

/* Desktop adjustments for dismiss button */
@media (min-width: 992px) {
    #dismiss {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 12px;
        top: 2px;
        right: 2px;
    }
}

@media (max-width: 991px) {
    #sidebar {
        margin-left: -320px; /* Ensure it's hidden initially */
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 999;
        transition: all 0.3s;
        /* Remove shadow when hidden to prevent bleeding */
        box-shadow: none; 
    }
    
    #sidebar.active {
        margin-left: 0;
        /* Add shadow only when active */
        box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.2);
    }
}

@media (max-width: 768px) {
    #content {
        padding: 0;
    }
    #content > .container-fluid {
        padding: 10px !important; /* Reduce padding on mobile */
    }
}

/* Fix for sticky hover on mobile devices for outline buttons */
@media (hover: none) {
    .btn-outline-success:hover {
        color: #198754; /* Bootstrap success color */
        background-color: transparent;
        border-color: #198754;
    }
    
    .btn-outline-success:active {
        color: #fff;
        background-color: #198754;
        border-color: #198754;
    }
}

/* Audio Player Overlay on Desktop */
@media (min-width: 992px) {
    .audio-player-wrapper {
        position: relative;
        z-index: 100;
        width: 150px; /* Tighter fixed width */
    }

    /* Remove bottom margin from button on desktop */
    .audio-player-wrapper .btn {
        margin-bottom: 0 !important;
    }
    
    .audio-player-wrapper .collapse,
    .audio-player-wrapper .collapsing {
        position: absolute;
        right: 0;
        top: 100%;
        width: 340px; /* Slightly wider to fit time display */
        margin-top: 2px; /* Minimal gap */
    }
}

/* Custom hover effect for list items */
.list-group-item-action.hover-success:hover,
.list-group-item-action.hover-success:focus {
    background-color: var(--light-green);
    color: var(--text-dark);
    border-color: #c8e6c9;
    z-index: 1;
}

/* Custom hover effect for table rows */
.table-hover-success tbody tr:hover > * {
    background-color: var(--light-green);
    color: var(--text-dark);
    transition: background-color 0.2s ease;
}

/* Custom hover effect for card-like lists */
.hover-card {
    transition: all 0.2s ease-in-out;
    cursor: default;
}

.hover-card:hover {
    background-color: var(--light-green) !important; /* Override bg-light */
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important; /* Boost shadow */
}

/* Hover effect for colored cards (scale only) */
.hover-scale {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: default;
}

.hover-scale:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.2) !important;
    filter: brightness(105%); /* Slightly brighten the color */
}

/* Table hover lift effect */
.table-hover-lift {
    border-collapse: separate; 
    border-spacing: 0 4px; /* Add spacing between rows */
}

.table-hover-lift tbody tr {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.2s ease;
    border-radius: 8px;
}

.table-hover-lift tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    background-color: var(--light-green);
    position: relative;
    z-index: 1;
}

.table-hover-lift tbody tr:hover > td {
    color: var(--text-dark);
    background-color: transparent; 
}

.table-hover-lift tbody tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.table-hover-lift tbody tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}


/* Quote Styles */
.quote-box {
    padding: 1.5rem;
    border-radius: 0.25rem;
    background-color: var(--light-green);
    border-left: 4px solid;
    margin-bottom: 1rem;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

.quote-quran {
    border-left-color: var(--primary-green);
}

.quote-quran .quote-icon {
    color: var(--primary-green);
}

.quote-hadith {
    border-left-color: var(--secondary-green);
}

.quote-hadith .quote-icon {
    color: var(--secondary-green);
}

.quote-icon {
    opacity: 0.5;
    margin-right: 1rem;
    margin-top: 0.25rem;
    font-size: 1.5em;
}

.quote-text {
    margin-bottom: 0.5rem;
    font-style: italic;
    color: var(--text-dark);
}

.quote-footer {
    text-align: right;
    font-size: 0.875em;
    font-weight: bold;
    color: var(--primary-green);
}

/* Sifati List Number Styling */
.sifat-number {
    min-width: 30px;
    margin: 0 1rem; /* Equivalent to mx-3 */
    font-weight: bold;
    text-align: center; /* Optional but looks better */
}

@media (max-width: 576px) {
    .sifat-number {
        margin: 0 0.5rem 0 0; /* Remove left margin */
        min-width: 23px;
    }
}
/* Rotate chevron when expanded */
[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Hide toggle hint when expanded */
[aria-expanded="true"] .toggle-hint {
    display: none;
}

.fa-chevron-down {
    transition: transform 0.3s ease;
}