body {
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
    padding-bottom: 20px;
    transition: background 0.3s ease, color 0.3s ease;
}

body.light {
    background: linear-gradient(135deg, #f0f2f5, #e0f7fa);
    color: #333;
}

body.dark {
    background: linear-gradient(135deg, #1e1e1e, #2d3436);
    color: #e0e0e0;
}

body.blue {
    background: linear-gradient(135deg, #bbdefb, #1976d2);
    color: #fff;
}

.navbar {
    background-color: #2e7d32 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.navbar-brand {
    font-size: 22px;
    font-weight: 700;
    color: #fff !important;
}

.form-select, #searchInput {
    max-width: 150px;
    border-radius: 20px;
    padding: 5px 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.list-group {
    border-radius: 15px;
    overflow: hidden;
    background-color: transparent;
}

.list-group-item {
    border: none;
    margin-bottom: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

body.dark .list-group-item {
    background-color: rgba(50, 50, 50, 0.95);
    color: #e0e0e0;
}

body.blue .list-group-item {
    background-color: rgba(25, 118, 210, 0.95); /* أزرق داكن متناسق */
    color: #fff;
}

.list-group-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    color: #2e7d32; /* أخضر مريح */
}

body.dark .category-header {
    color: #a5d6a7; /* أخضر فاتح مريح للثيم الداكن */
}

body.blue .category-header {
    color: #bbdefb; /* أزرق فاتح مريح */
}

.category-header:hover {
    background-color: #e8f5e9; /* خلفية خضراء فاتحة مريحة */
    color: #2e7d32;
}

body.dark .category-header:hover {
    background-color: #616161;
    color: #a5d6a7;
}

body.blue .category-header:hover {
    background-color: #64b5f6;
    color: #bbdefb;
}

body.light .list-group-item.active .category-header {
    background-color: #ab47bc; /* بنفسجي جذاب */
    color: #fff;
}

body.dark .list-group-item.active .category-header {
    background-color: #66bb6a; /* أخضر جذاب للثيم الداكن */
    color: #fff;
}

body.blue .list-group-item.active .category-header {
    background-color: #42a5f5; /* أزرق جذاب */
    color: #fff;
}

.icon {
    font-size: 18px;
}

.toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.list-group-item.active .toggle-icon {
    transform: rotate(180deg);
}

[dir="rtl"] .category-header {
    flex-direction: row;
    justify-content: flex-start;
}

[dir="ltr"] .category-header {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .icon {
    margin-left: 10px;
}

[dir="ltr"] .icon {
    margin-right: 10px;
}

.content-container {
    padding: 0 15px;
    background-color: #f5f7f5; /* خلفية رمادية خضراء فاتحة مريحة */
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
    max-height: 0;
    overflow-y: hidden; /* إخفاء التمرير أولاً */
    transition: max-height 0.3s ease-out;
}

.content-container.open {
    max-height: 350px; /* ارتفاع أكبر لضمان التمرير */
    overflow-y: auto; /* تفعيل التمرير العمودي */
    padding: 15px;
}

body.dark .content-container {
    background-color: #424242; /* رمادي داكن مريح */
    border-top: 1px solid #616161;
}

body.blue .content-container {
    background-color: #bbdefb; /* أزرق فاتح مريح */
    border-top: 1px solid #90caf9;
}

.content-text {
    font-family: 'Cairo', sans-serif;
    white-space: pre-wrap;
    font-size: 16px;
    line-height: 1.8;
    color: #1b5e20; /* أخضر داكن مريح للعين */
    margin: 0;
}

body.dark .content-text {
    color: #c8e6c9; /* أخضر فاتح مريح للثيم الداكن */
}

body.blue .content-text {
    color: #0d47a1; /* أزرق داكن مريح */
}

.highlighted {
    background-color: #fff9c4; /* أصفر فاتح مريح */
}

body.dark .highlighted,
body.blue .highlighted {
    background-color: #fff176; /* أصفر دافئ */
    color: #333;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.audio-controls .btn {
    padding: 5px 10px;
    font-size: 14px;
    min-width: 80px;
}

.volume-slider {
    width: 100px;
}

.notes-text {
    font-size: 14px;
    resize: none;
    height: 60px;
    background-color: #fafafa; /* خلفية فاتحة مريحة */
}

body.dark .notes-text {
    background-color: #616161;
    color: #e0e0e0;
}

body.blue .notes-text {
    background-color: #e3f2fd;
    color: #0d47a1;
}

.share-btn {
    font-size: 14px;
}

.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: #4caf50;
    color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2e7d32;
    border-radius: 4px;
}

body.dark ::-webkit-scrollbar-track {
    background: #424242;
}

body.dark ::-webkit-scrollbar-thumb {
    background: #66bb6a;
}

body.blue ::-webkit-scrollbar-track {
    background: #bbdefb;
}

body.blue ::-webkit-scrollbar-thumb {
    background: #1976d2;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    .navbar-brand {
        font-size: 18px;
    }
    .form-select, #searchInput {
        max-width: 120px;
        font-size: 14px;
    }
    .category-header {
        font-size: 16px;
        padding: 10px 12px;
    }
    .content-text {
        font-size: 14px;
    }
    .content-container.open {
        max-height: 300px; /* ارتفاع مناسب للهواتف */
    }
    .audio-controls .btn {
        min-width: 60px;
        font-size: 12px;
    }
    .volume-slider {
        width: 80px;
    }
}