﻿/* ========================================================================= */
/* إعدادات وتنسيقات أداة تيسير الوصول - جامعة الملك فيصل */
/* ========================================================================= */
:root {
    /* ألوان الأداة الافتراضية */
    --a11y-primary: #15803d;      /* اللون الأساسي (الأخضر) */
    --a11y-primary-dark: #14532d; /* لون التدرج الأغمق */
    --a11y-primary-light: #f0fdf4;/* لون الخلفية الفاتح عند التمرير */
    --a11y-primary-border: #86efac;/* لون الحدود عند التمرير */
    
    /* ألوان الذكاء الاصطناعي */
    --a11y-ai-color: #eab308;     /* اللون الذهبي */
    --a11y-ai-dark: #ca8a04;      /* الذهبي الغامق */
}
#a11y-widget-container {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
}
#a11y-widget-container[dir="rtl"] { direction: rtl; text-align: right; }
#a11y-widget-container[dir="ltr"] { direction: ltr; text-align: left; }

#a11y-widget-container[dir="rtl"] #a11y-toggle-btn { right: 30px !important; left: auto !important; }
#a11y-widget-container[dir="ltr"] #a11y-toggle-btn { left: 30px !important; right: auto !important; }

#a11y-widget-container[dir="rtl"] #a11y-panel { right: 20px !important; left: auto !important; transform: translateX(120%); }
#a11y-widget-container[dir="ltr"] #a11y-panel { left: 20px !important; right: auto !important; transform: translateX(-120%); }

#a11y-widget-container[dir="rtl"] #a11y-panel.open,
#a11y-widget-container[dir="ltr"] #a11y-panel.open { transform: translateX(0); }

#a11y-widget-container * { box-sizing: border-box; }

@keyframes a11y-pulse {
    0% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(21, 128, 61, 0); }
    100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
}

#a11y-toggle-btn {
    position: fixed; bottom: 30px; width: 64px; height: 64px;
    background: linear-gradient(135deg, #15803d 0%, #14532d 100%); color: white;
    border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 25px -5px rgba(21, 128, 61, 0.5); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999999; animation: a11y-pulse 2.5s infinite;
}
#a11y-toggle-btn:hover { transform: scale(1.1) rotate(5deg); box-shadow: 0 15px 35px -5px rgba(21, 128, 61, 0.6); }

#a11y-panel {
    position: fixed; top: 20px; bottom: 20px; height: calc(100vh - 40px); width: 360px; max-width: calc(100vw - 40px);
    background-color: rgba(255, 255, 255, 0.95); backdrop-filter: blur(16px); border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.05); z-index: 1000000;
    display: flex; flex-direction: column; opacity: 0; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden; pointer-events: none;
}
#a11y-panel.open { opacity: 1; pointer-events: auto; }

.a11y-header {
    display: flex; justify-content: space-between; align-items: center; padding: 20px 24px;
    background: linear-gradient(to bottom, #ffffff, rgba(255,255,255,0)); border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}
.a11y-header h2 { margin: 0; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 10px; color: #1f2937; }
.a11y-header-icon { background: #f0fdf4; color: #15803d; padding: 8px; border-radius: 12px; display: flex; }
.a11y-controls { display: flex; align-items: center; gap: 8px; }
.a11y-btn-circle {
    background: #f3f4f6; border: none; border-radius: 50%; height: 36px; cursor: pointer; color: #6b7280;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s; font-weight: bold; font-size: 13px;
}
.a11y-btn-circle:hover { background: #e5e7eb; color: #1f2937; }
.a11y-close-btn { width: 36px; }
.a11y-lang-btn { padding: 0 12px; border-radius: 18px; }

.a11y-content::-webkit-scrollbar { width: 6px; }
.a11y-content::-webkit-scrollbar-track { background: transparent; }
.a11y-content::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
.a11y-content::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.a11y-content { padding: 24px; overflow-y: auto; flex: 1; }
.a11y-section { margin-bottom: 28px; }
.a11y-section-title { font-size: 13px; font-weight: 700; color: #9ca3af; margin: 0 0 16px 0; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.a11y-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 8px;
    border: 1px solid #e5e7eb; border-radius: 16px; background-color: #ffffff; color: #4b5563; cursor: pointer;
    transition: all 0.2s ease; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.a11y-btn:hover { background-color: #f0fdf4; border-color: #86efac; color: #15803d; transform: translateY(-2px); box-shadow: 0 6px 12px -2px rgba(21, 128, 61, 0.1); }
.a11y-btn.active { background: linear-gradient(135deg, #15803d 0%, #14532d 100%); border-color: transparent; color: #ffffff; box-shadow: 0 10px 15px -3px rgba(21, 128, 61, 0.3); }

.a11y-btn.a11y-ai-btn { border-color: #fde047; background: #fefce8; color: #a16207; }
.a11y-btn.a11y-ai-btn:hover { background-color: #fef9c3; border-color: #facc15; color: #854d0e; }
.a11y-btn.a11y-ai-btn.active { background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%); color: white; border-color: transparent; }

.a11y-btn-icon { margin-bottom: 10px; opacity: 0.9; }
.a11y-btn-label { font-size: 13px; font-weight: 600; line-height: 1.3; }

.a11y-levels { display: flex; gap: 4px; margin-top: 10px; direction: ltr; }
.a11y-level-dash { height: 4px; width: 14px; border-radius: 3px; transition: background-color 0.3s; }

.a11y-footer {
    padding: 20px 24px; background: linear-gradient(to top, #ffffff, rgba(255,255,255,0.9)); border-top: 1px solid rgba(229, 231, 235, 0.5);
}
.a11y-reset-btn {
    width: 100%; display: flex; justify-content: center; align-items: center; gap: 10px; background-color: #fff1f2;
    color: #e11d48; border: 1px solid #fecdd3; padding: 14px; border-radius: 14px; font-weight: bold; font-size: 14px;
    cursor: pointer; transition: all 0.2s;
}
.a11y-reset-btn:hover { background-color: #ffe4e6; border-color: #fda4af; transform: translateY(-1px); box-shadow: 0 4px 6px -1px rgba(225, 29, 72, 0.1); }

#a11y-reading-guide { position: fixed; left: 0; right: 0; height: 8px; background: linear-gradient(90deg, rgba(21,128,61,0.1) 0%, rgba(21,128,61,0.6) 50%, rgba(21,128,61,0.1) 100%); pointer-events: none; z-index: 99998; box-shadow: 0 0 15px rgba(21,128,61,0.3); display: none; }
#a11y-reading-mask { position: fixed; left: 0; right: 0; height: 120px; background: transparent; pointer-events: none; z-index: 99997; box-shadow: 0 -200vh 0 200vh rgba(0,0,0,0.7), 0 200vh 0 200vh rgba(0,0,0,0.7); display: none; }

#a11y-grayscale-overlay {
    position: fixed; inset: 0; pointer-events: none; z-index: 99996;
    backdrop-filter: grayscale(100%); -webkit-backdrop-filter: grayscale(100%);
    display: none;
}

body.a11y-reader-active *:hover:not(#a11y-widget-container):not(#a11y-widget-container *) {
    outline: 2px dashed #15803d !important; cursor: pointer !important; background-color: rgba(21, 128, 61, 0.1) !important; border-radius: 4px; box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.2); transition: all 0.2s;
}

#a11y-ai-floating-btn {
    position: absolute !important;
    z-index: 9999999 !important;
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(202, 138, 4, 0.4) !important;
    display: none; /* يجب أن يكون مخفياً افتراضياً */
    gap: 6px !important;
    align-items: center !important;
}
@keyframes a11y-pop { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
#a11y-ai-tooltip {
    position: absolute !important;
    z-index: 10000000 !important;
    background: white !important;
    color: #1f2937 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 16px !important;
    width: 300px !important;
    max-width: 90vw !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
    display: none; /* يجب أن يكون مخفياً افتراضياً */
    font-size: 14px !important;
    line-height: 1.6 !important;
}

.a11y-ai-tooltip-header { 
    display: flex !important; 
    justify-content: space-between !important; 
    align-items: center !important; 
    margin-bottom: 10px !important; 
    border-bottom: 1px solid #f3f4f6 !important; 
    padding-bottom: 8px !important; 
    font-weight: bold !important; 
    color: #a16207 !important; 
}

.a11y-ai-tooltip-close { 
    background: none !important; 
    border: none !important; 
    color: #9ca3af !important; 
    cursor: pointer !important; 
    font-size: 16px !important; 
}

.a11y-ai-tooltip-close:hover { 
    color: #1f2937 !important; 
}
#voice-status-overlay {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.8); color: white;
    padding: 15px 25px; border-radius: 30px; z-index: 9999999; display: none; align-items: center; gap: 10px; font-weight: bold; box-shadow: 0 4px 15px rgba(0,0,0,0.3); font-family: system-ui, sans-serif;
}
.mic-icon-pulsing {
    width: 15px; height: 15px; background: #eab308; border-radius: 50%; animation: pulse-gold 1s infinite;
}
@keyframes pulse-gold { 0% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(234, 179, 8, 0); } 100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0); } }