:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333333;
    --light-text: #7f8c8d;
    --background-color: #ffffff;
    --input-bg: #f9f9f9;
    --input-border: #e0e0e0;
    --focus-border: #3498db;
    --button-hover: #2980b9;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --text-size: 16px;
    --icon-scale: 1;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --panel-width: 300px;
    --braille-size: 24px;
    --content-scale: 1;
}

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: 'Tajawal', 'Segoe UI', sans-serif;
            background-color: var(--background-color);
            color: var(--text-color);
            line-height: 1.8;
            transition: var(--transition);
            min-height: 100vh;
            display: flex;
            position: relative;
            overflow-x: hidden;
            font-size: var(--text-size);
        }

        /* --- FIXED SIDEBAR SLIDE FOR MAIN PAGE (RTL, overlays content, correct margin) --- */
#controlPanel, .control-panel {
    right: 0;
    left: auto;
    width: var(--panel-width);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1), width 0.3s cubic-bezier(.4,0,.2,1);
    position: fixed;
    top: 0;
    height: 100vh;
    z-index: 1000;
    box-shadow: -5px 0 25px rgba(0,0,0,0.2);
}
#controlPanel:not(.panel-collapsed), .control-panel:not(.panel-collapsed) {
    transform: translateX(0);
    width: var(--panel-width);
}
#controlPanel.panel-collapsed, .control-panel.panel-collapsed {
    transform: translateX(100%);
    width: 60px;
    overflow: hidden;
}

.main-content {
    transition: margin-right 0.3s cubic-bezier(.4,0,.2,1);
    margin-right: 0;
}
#controlPanel:not(.panel-collapsed) ~ .main-content,
.control-panel:not(.panel-collapsed) ~ .main-content {
    margin-right: var(--panel-width);
}

        /* لوحة التحكم الرئيسية */
.control-panel {
    width: var(--panel-width);
    height: 100vh;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    z-index: 100;
    overflow-y: auto;
    position: fixed;
    top: 0;
    right: 0;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    transition: width 0.3s ease, transform 0.3s ease;
    transform: translateX(calc(var(--panel-width) - 60px));
}

.control-panel.panel-collapsed {
    transform: translateX(calc(var(--panel-width) * -1 + 60px));
    width: 60px;
    overflow: hidden;
}

.main-content {
    transition: margin-left 0.3s ease;
    margin-left: var(--panel-width);
}

.control-panel.panel-collapsed ~ .main-content {
    margin-left: 60px;
}

.panel-collapsed {
    transform: translateX(calc(var(--panel-width) * -1 + 60px));
}

.control-panel.panel-collapsed {
    transform: translateX(calc(var(--panel-width) * -1 + 60px));
}

        .panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid rgba(255, 255, 255, 0.15);
        }

        .panel-title {
            font-size: 1.3rem;
            font-weight: 800;
            color: white;
            letter-spacing: 1px;
        }

        .toggle-panel {
            background: rgba(255, 255, 255, 0.15);
            border: none;
            color: white;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        .toggle-panel:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: rotate(90deg);
        }

        .control-group {
            margin-bottom: 25px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            padding-bottom: 20px;
        }

        .control-group:last-child {
            border-bottom: none;
        }

        .control-label {
            display: block;
            margin-bottom: 15px;
            font-size: 1rem;
            font-weight: 700;
            color: rgba(255, 255, 255, 0.9);
            letter-spacing: 0.5px;
            position: relative;
            padding-right: 10px;
        }

        .control-label::after {
            content: '';
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 16px;
            background: var(--secondary-color);
            border-radius: 2px;
        }

        .control-btn {
            width: 100%;
            padding: 14px 20px;
            border: none;
            border-radius: var(--border-radius);
            background: rgba(255, 255, 255, 0.08);
            color: white;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 10px;
            text-align: right;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            border-left: 3px solid transparent;
        }

        .control-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateX(-5px);
            border-left: 3px solid var(--accent-color);
        }

        .control-btn.active {
            background: var(--accent-color);
            box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
            border-left: 3px solid white;
        }

        .control-btn i {
            font-size: 1.2rem;
            min-width: 24px;
            text-align: center;
            transform: scale(var(--icon-scale));
        }

        .slider-container {
            width: 100%;
            margin: 20px 0;
        }

        .slider-label {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            font-size: 0.95rem;
            color: rgba(255, 255, 255, 0.9);
            font-weight: 600;
        }

        .slider {
            width: 100%;
            -webkit-appearance: none;
            appearance: none;
            height: 8px;
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.2);
            outline: none;
            transition: var(--transition);
        }

        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: var(--secondary-color);
            cursor: pointer;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
            transition: var(--transition);
            border: 3px solid white;
        }

        .slider::-webkit-slider-thumb:hover {
            transform: scale(1.2);
            background: var(--button-hover);
        }

        /* منطقة المحتوى الرئيسية */
        .main-content {
            flex: 1;
            margin-right: var(--panel-width);
            transition: margin 0.3s ease;
            padding: 30px;
            min-height: 100vh;
        }

        .panel-collapsed ~ .main-content {
            margin-right: 0;
        }

        /* تصميم الصفحات المختلفة */
        .page-container {
            max-width: 1200px;
            margin: 0 auto;
            animation: fadeIn 0.5s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .page-title {
            text-align: center;
            margin-bottom: 30px;
            color: var(--primary-color);
            font-size: calc(2rem * var(--icon-scale));
            font-weight: 800;
            position: relative;
            padding-bottom: 15px;
        }

        .page-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 4px;
            background: linear-gradient(to right, var(--secondary-color), var(--accent-color));
            border-radius: 3px;
        }

        .buttons-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
            margin-top: 40px;
        }

        .specialty-btn, .course-btn, .need-btn {
            background: linear-gradient(135deg, var(--secondary-color) 0%, var(--button-hover) 100%);
            color: white;
            border: none;
            border-radius: var(--border-radius);
            padding: calc(25px * var(--icon-scale)) calc(20px * var(--icon-scale));
            font-size: calc(1.1rem * var(--icon-scale));
            font-weight: 700;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            box-shadow: var(--shadow);
            position: relative;
            overflow: hidden;
            min-height: calc(120px * var(--icon-scale));
        }

        .specialty-btn:hover, .course-btn:hover, .need-btn:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        }

        .specialty-btn i, .course-btn i, .need-btn i {
            font-size: calc(2.5rem * var(--icon-scale));
            margin-bottom: calc(15px * var(--icon-scale));
            transition: var(--transition);
        }

        .specialty-btn:hover i, .course-btn:hover i, .need-btn:hover i {
            transform: scale(1.2);
        }

        .back-btn {
            background: var(--light-text);
            color: white;
            border: none;
            border-radius: var(--border-radius);
            padding: calc(12px * var(--icon-scale)) calc(25px * var(--icon-scale));
            font-size: calc(1rem * var(--icon-scale));
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: calc(8px * var(--icon-scale));
            margin-bottom: calc(30px * var(--icon-scale));
            box-shadow: var(--shadow);
        }

        .back-btn:hover {
            background: #6c757d;
            transform: translateX(-5px);
        }

        /* صفحة المواد الدراسية */
        .course-details {
            background: white;
            border-radius: var(--border-radius);
            padding: calc(30px * var(--icon-scale));
            box-shadow: var(--shadow);
            margin-top: calc(30px * var(--icon-scale));
        }

        .course-header {
            display: flex;
            align-items: center;
            gap: calc(20px * var(--icon-scale));
            margin-bottom: calc(20px * var(--icon-scale));
            padding-bottom: calc(20px * var(--icon-scale));
            border-bottom: 1px solid var(--input-border);
        }

        .course-icon {
            font-size: calc(3rem * var(--icon-scale));
            color: var(--secondary-color);
        }

        .course-title {
            font-size: calc(1.8rem * var(--icon-scale));
            font-weight: 800;
            color: var(--primary-color);
            margin-bottom: calc(5px * var(--icon-scale));
        }

        .course-description {
            color: var(--light-text);
            line-height: 1.6;
            font-size: calc(1rem * var(--icon-scale));
        }

        /* صفحة الاحتياجات الخاصة */
        .needs-section {
            margin-top: calc(40px * var(--icon-scale));
        }

        .needs-title {
            font-size: calc(1.5rem * var(--icon-scale));
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: calc(20px * var(--icon-scale));
            text-align: center;
        }

        /* صفحة المحتوى التعليمي */
        .content-container {
            display: flex;
            flex-wrap: wrap;
            gap: calc(30px * var(--icon-scale));
            margin-top: calc(30px * var(--icon-scale));
        }

        .content-section {
            flex: 1;
            min-width: calc(300px * var(--icon-scale));
            background: white;
            border-radius: var(--border-radius);
            padding: calc(25px * var(--icon-scale));
            box-shadow: var(--shadow);
        }

        .section-title {
            font-size: calc(1.4rem * var(--icon-scale));
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: calc(20px * var(--icon-scale));
            padding-bottom: calc(10px * var(--icon-scale));
            border-bottom: 2px solid var(--secondary-color);
            display: flex;
            align-items: center;
            gap: calc(10px * var(--icon-scale));
        }

        .section-title i {
            color: var(--accent-color);
            font-size: calc(1.4rem * var(--icon-scale));
        }

        .content-list {
            list-style: none;
        }

        .content-item {
            padding: calc(15px * var(--icon-scale)) 0;
            border-bottom: 1px dashed var(--input-border);
        }

        .content-item:last-child {
            border-bottom: none;
        }

        .content-link {
            display: flex;
            align-items: center;
            gap: calc(10px * var(--icon-scale));
            color: var(--text-color);
            text-decoration: none;
            transition: var(--transition);
            font-weight: 500;
            font-size: calc(1rem * var(--icon-scale));
        }

        .content-link:hover {
            color: var(--secondary-color);
            transform: translateX(5px);
        }

        .content-link i {
            color: var(--accent-color);
            font-size: calc(1.2rem * var(--icon-scale));
        }

        /* نافذة المحتوى المنبثقة */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            display: flex;
            justify-content: center;
            align-items: center;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .modal-content {
            background-color: var(--background-color);
            border-radius: var(--border-radius);
            width: 90%;
            max-width: 1000px;
            max-height: 90vh;
            overflow-y: auto;
            padding: 30px;
            position: relative;
            transform: translateY(50px);
            transition: transform 0.3s ease;
        }

        .modal-overlay.active .modal-content {
            transform: translateY(0);
        }

        .close-modal {
            position: absolute;
            top: 15px;
            left: 15px;
            font-size: 1.5rem;
            color: var(--accent-color);
            cursor: pointer;
            background: none;
            border: none;
            z-index: 10;
        }

        .modal-header {
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--input-border);
        }

        .modal-title {
            font-size: 1.5rem;
            color: var(--primary-color);
            margin-bottom: 10px;
        }

        .modal-body {
            margin-top: 20px;
        }

        .video-container {
            position: relative;
            padding-bottom: 56.25%;
            height: 0;
            overflow: hidden;
            margin: 20px 0;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            transform: scale(var(--content-scale));
            transform-origin: center top;
        }

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

        .audio-player {
            width: 100%;
            margin: 20px 0;
            border-radius: var(--border-radius);
            transform: scale(var(--content-scale));
            transform-origin: center top;
        }

        .document-viewer {
            width: 100%;
            height: 70vh;
            border: 1px solid var(--input-border);
            border-radius: var(--border-radius);
            transform: scale(var(--content-scale));
            transform-origin: center top;
            margin: 20px 0;
        }

        /* غرفة الدراسة */
        .study-room {
            background: white;
            border-radius: var(--border-radius);
            padding: calc(30px * var(--icon-scale));
            box-shadow: var(--shadow);
            margin-top: calc(30px * var(--icon-scale));
        }

        .room-header {
            display: flex;
            align-items: center;
            gap: calc(15px * var(--icon-scale));
            margin-bottom: calc(25px * var(--icon-scale));
        }

        .room-title {
            font-size: calc(1.8rem * var(--icon-scale));
            font-weight: 800;
            color: var(--primary-color);
            margin-bottom: calc(5px * var(--icon-scale));
        }

        .room-description {
            color: var(--light-text);
            line-height: 1.6;
            margin-bottom: calc(20px * var(--icon-scale));
            font-size: calc(1rem * var(--icon-scale));
        }

        .room-features {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: calc(20px * var(--icon-scale));
            margin-top: calc(30px * var(--icon-scale));
        }

        .feature-card {
            background: var(--input-bg);
            border-radius: var(--border-radius);
            padding: calc(20px * var(--icon-scale));
            transition: var(--transition);
        }

        .feature-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow);
        }

        .feature-icon {
            font-size: calc(2rem * var(--icon-scale));
            color: var(--secondary-color);
            margin-bottom: calc(15px * var(--icon-scale));
        }

        .feature-title {
            font-size: calc(1.2rem * var(--icon-scale));
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: calc(10px * var(--icon-scale));
        }

        .feature-desc {
            color: var(--light-text);
            font-size: calc(0.95rem * var(--icon-scale));
            line-height: 1.6;
        }

        .submit-btn {
            background: linear-gradient(135deg, var(--secondary-color) 0%, var(--button-hover) 100%);
            color: white;
            border: none;
            border-radius: var(--border-radius);
            padding: calc(15px * var(--icon-scale)) calc(30px * var(--icon-scale));
            font-size: calc(1.1rem * var(--icon-scale));
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: calc(10px * var(--icon-scale));
            margin-top: calc(30px * var(--icon-scale));
            box-shadow: var(--shadow);
        }

        .submit-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
        }

        /* أنظمة الثيمات لعمى الألوان */
         [data-theme="protanopia"] {
          --primary-color: #3a7ca5;        
          --secondary-color: #f0a202;      
         --button-hover: #d18b00;         
          --accent-color: #00a6a6;         
          --text-color: #1a1a1a;          
          --background-color: #f3f3f3;    
         --input-bg: #ffffff;            
          --input-border: #3a7ca5;         
}

[data-theme="deuteranopia"] {
        --primary-color: #057dc2;      
        --secondary-color:  #057dc2;    
        --button-hover: #005f99;      
        --accent-color: #56B4E9;     
         --text-color: #111111;        
         --background-color: #F0F0F0;   
         --input-bg: #FFFFFF;          
          --input-border: #0072B2;       
}


 
[data-theme="tritanopia"] {
          --primary-color: #880000;     
        --secondary-color: #136621;   
        --button-hover: #b30000;      
        --accent-color: #9b009b;      
         --text-color: #111111;        
       --background-color: #f7f7f7;  
        --input-bg: #ffffff;          
      --input-border: #003f88;      
}

/* Filters for color blindness */
.protanopia-filter {
    filter: url('#protanopiaFilter');
}

.deuteranopia-filter {
    filter: url('#deuteranopiaFilter');
}

.tritanopia-filter {
    filter: url('#tritanopiaFilter');
}

.achromatopsia-filter {
    filter: grayscale(100%);
}

.high-contrast-filter {
    filter: contrast(200%) brightness(150%);
}

        [data-theme="achromatopsia"] {
            --primary-color: #555555;
            --secondary-color: #888888;
            --button-hover: #777777;
            --accent-color: #222222;
            --text-color: #333;
            --background-color: #f5f5f5;
            --input-bg: #e8e8e8;
            --input-border: #d0d0d0;
        }

        [data-theme="high-contrast"] {
            --primary-color: #000000;
            --secondary-color: #0e0e0e;
            --button-hover: #cccccc;
            --accent-color: #ff0000;
            --text-color: #3d3d3d;
            --background-color: #000000;
            --input-bg: #0a0909;
            --input-border: #ffffff;
        }

        /* تحسينات للجوال */
        @media (max-width: 992px) {
            #controlPanel, .control-panel {
                width: var(--panel-width);
            }
            .main-content {
                margin-right: 0;
                padding: 20px 10px;
            }
            #controlPanel:not(.panel-collapsed) ~ .main-content,
            .control-panel:not(.panel-collapsed) ~ .main-content {
                margin-right: var(--panel-width);
            }
        }

        @media (max-width: 576px) {
            :root {
                --panel-width: 280px;
            }
            
            .buttons-grid {
                grid-template-columns: 1fr;
            }
            
            .specialty-btn, .course-btn, .need-btn {
                min-height: 100px;
                padding: 20px 15px;
            }
            
            .modal-content {
                width: 95%;
                padding: 20px 15px;
            }
        }

        /* تحسينات للواجهة المظلمة */
        @media (prefers-color-scheme: dark) {
            :root:not([data-theme]) {
                --text-color: #f0f0f0;
                --background-color: #121212;
                --input-bg: #1e1e1e;
                --input-border: #333;
                --light-text: #aaa;
            }
            
            .control-panel:not([data-theme]) {
                background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
            }
            
            .course-details, .content-section, .study-room, .feature-card {
                background: #1e1e1e;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            }
            
            .modal-content {
                background-color: var(--background-color);
            }
        }

        /* تهيئة لقارئ الشاشة */
        .screen-reader-only {
            position: absolute;
            left: -10000px;
            top: auto;
            width: 1px;
            height: 1px;
            overflow: hidden;
        }

        [aria-hidden="true"] {
            display: none;
        }

        /* تحسينات للوصول الشامل */
        :focus {
            outline: 3px solid var(--accent-color);
            outline-offset: 2px;
        }

        button, [role="button"], [tabindex="0"] {
            cursor: pointer;
            user-select: none;
        }

        /* أنماط خاصة لعسر القراءة */
        .dyslexia-mode {
            font-family: 'Comic Sans MS', 'Tajawal', sans-serif;
            letter-spacing: 1px;
            line-height: 2;
            word-spacing: 0.3rem;
        }

        .dyslexia-mode p, .dyslexia-mode li, .dyslexia-mode span {
            font-weight: 500;
        }

        /* أنماط خاصة لوضع برايل */
        .braille-mode .braille-text {
            display: inline;
            font-family: 'Braille', monospace;
            font-size: var(--braille-size);
            line-height: 2;
        }

        .braille-mode .normal-text {
            display: none;
        }

        /* أنماط التحميل */
        .loader {
            border: 5px solid #f3f3f3;
            border-top: 5px solid var(--secondary-color);
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin: 30px auto;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .error-message {
            color: var(--accent-color);
            text-align: center;
            padding: 20px;
            font-weight: bold;
        }

        /* عناصر التحكم بالمحتوى */
        .content-controls {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin: 20px 0;
        }

        .content-control-btn {
            background: var(--secondary-color);
            color: white;
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition);
            box-shadow: var(--shadow);
        }

        .content-control-btn:hover {
            background: var(--button-hover);
            transform: scale(1.1);
        }

        /* لوحة التحكم الإدارية */
        .admin-panel {
            position: fixed;
            bottom: 20px;
            left: 20px;
            z-index: 1000;
        }

        .admin-btn {
            background: var(--accent-color);
            color: white;
            border: none;
            border-radius: 50%;
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: var(--transition);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            font-size: 1.5rem;
        }

        .admin-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        }

        .admin-menu {
            position: absolute;
            bottom: 70px;
            left: 0;
            background: white;
            border-radius: var(--border-radius);
            padding: 15px;
            box-shadow: var(--shadow);
            display: none;
            width: 250px;
        }

        .admin-menu.active {
            display: block;
        }

        .admin-menu-item {
            padding: 10px;
            cursor: pointer;
            border-radius: var(--border-radius);
            transition: var(--transition);
        }

        .admin-menu-item:hover {
            background: var(--input-bg);
        }

        .floating-menu-btn {
            position: fixed;
            top: 30px;
            right: 30px;
            z-index: 200;
            background: var(--primary-color);
            color: #fff;
            border: none;
            border-radius: 50%;
            width: 48px;
            height: 48px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
            cursor: pointer;
            transition: background 0.2s;
        }

        .floating-menu-btn:hover {
            background: var(--secondary-color);
        }

        /* Hide the button when sidebar is open */
        .control-panel:not(.panel-collapsed) ~ #openSidebarBtn {
            display: none;
        }


/* Give the content body a stacking context and a lower layer */
#modalBody {
    position: relative;
    z-index: 1;
    /* This will make the zoom animation smoother */
    transition: transform 0.2s ease-in-out;
}

/* Give the controls a higher layer so they always stay on top */
#contentControls {
    position: relative;
    z-index: 2;
}

/* --- Style for the Logout Button --- */
.logout-btn i {
    color: var(--accent-color); /* Makes the icon red */
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.25); /* Use accent color on hover */
    border-left-color: #fff; /* White border on hover for contrast */
}