/* =====================================================
   همَّة الأسنان — ملف الأنماط الكامل
   Part 3/3: الحركات، الأدوات، الاستجابة
   ===================================================== */

/* =====================================================
   61. الحركات (Animations)
   ===================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 1000px; }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-24px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--primary-color); }
    50% { box-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-tint-strong); }
}

/* =====================================================
   62. Classes الحركات (Animation Classes)
   ===================================================== */
.animate-fade-in { animation: fadeIn 0.6s ease-out both; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out both; }
.animate-fade-in-down { animation: fadeInDown 0.6s ease-out both; }
.animate-fade-in-left { animation: fadeInLeft 0.6s ease-out both; }
.animate-fade-in-right { animation: fadeInRight 0.6s ease-out both; }
.animate-scale-in { animation: scaleIn 0.4s ease-out both; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-bounce { animation: bounce 2s ease-in-out infinite; }
.animate-shake { animation: shake 0.5s ease-in-out; }
.animate-rotate { animation: rotate 2s linear infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite; }

/* Fade In Up مع تأخير */
.fade-in-up { animation: fadeInUp 0.6s ease-out both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* No animation for reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =====================================================
   63. أدوات النص (Text Utilities)
   ===================================================== */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.text-justify { text-align: justify !important; }

.text-primary { color: var(--primary-color) !important; }
.text-primary-dark { color: var(--primary-dark) !important; }
.text-accent { color: var(--accent-dark) !important; }
.text-ink { color: var(--ink-color) !important; }
.text-grey { color: var(--grey-color) !important; }
.text-grey-light { color: var(--grey-light) !important; }
.text-white { color: white !important; }
.text-success { color: var(--green-color) !important; }
.text-danger { color: var(--red-color) !important; }
.text-warning { color: var(--yellow-dark) !important; }
.text-info { color: var(--blue-color) !important; }

.text-xs { font-size: 1.2rem !important; }
.text-sm { font-size: 1.4rem !important; }
.text-base { font-size: 1.6rem !important; }
.text-lg { font-size: 1.8rem !important; }
.text-xl { font-size: 2rem !important; }
.text-2xl { font-size: 2.4rem !important; }
.text-3xl { font-size: 3rem !important; }
.text-4xl { font-size: 3.6rem !important; }

.font-light { font-weight: 300 !important; }
.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-extrabold { font-weight: 800 !important; }

.leading-tight { line-height: 1.25 !important; }
.leading-normal { line-height: 1.5 !important; }
.leading-relaxed { line-height: 1.75 !important; }
.leading-loose { line-height: 2 !important; }

.uppercase { text-transform: uppercase !important; }
.lowercase { text-transform: lowercase !important; }
.capitalize { text-transform: capitalize !important; }

.underline { text-decoration: underline !important; }
.line-through { text-decoration: line-through !important; }
.no-underline { text-decoration: none !important; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =====================================================
   64. أدوات المسافات (Spacing Utilities)
   ===================================================== */

/* Margin Top */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mt-6 { margin-top: 4rem !important; }
.mt-7 { margin-top: 5rem !important; }

/* Margin Bottom */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mb-6 { margin-bottom: 4rem !important; }
.mb-7 { margin-bottom: 5rem !important; }

/* Margin Right / Left (RTL aware) */
.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: 0.5rem !important; }
.mr-2 { margin-right: 1rem !important; }
.mr-3 { margin-right: 1.5rem !important; }
.mr-4 { margin-right: 2rem !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: 0.5rem !important; }
.ml-2 { margin-left: 1rem !important; }
.ml-3 { margin-left: 1.5rem !important; }
.ml-4 { margin-left: 2rem !important; }

.mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* Padding */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.5rem !important; }
.p-2 { padding: 1rem !important; }
.p-3 { padding: 1.5rem !important; }
.p-4 { padding: 2rem !important; }
.p-5 { padding: 3rem !important; }
.p-6 { padding: 4rem !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.5rem !important; }
.pt-2 { padding-top: 1rem !important; }
.pt-3 { padding-top: 1.5rem !important; }
.pt-4 { padding-top: 2rem !important; }
.pt-5 { padding-top: 3rem !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: 0.5rem !important; }
.pb-2 { padding-bottom: 1rem !important; }
.pb-3 { padding-bottom: 1.5rem !important; }
.pb-4 { padding-bottom: 2rem !important; }
.pb-5 { padding-bottom: 3rem !important; }

.py-1 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-2 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-3 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-4 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

.px-1 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-2 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-3 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-4 { padding-left: 2rem !important; padding-right: 2rem !important; }
.px-5 { padding-left: 3rem !important; padding-right: 3rem !important; }

/* Gap */
.gap-0 { gap: 0 !important; }
.gap-1 { gap: 0.5rem !important; }
.gap-2 { gap: 1rem !important; }
.gap-3 { gap: 1.5rem !important; }
.gap-4 { gap: 2rem !important; }
.gap-5 { gap: 3rem !important; }

/* =====================================================
   65. أدوات العرض (Display Utilities)
   ===================================================== */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }
.d-table { display: table !important; }

/* Show/Hide Responsive */
.d-none-mobile { display: none !important; }
.d-none-desktop { display: initial !important; }

/* =====================================================
   66. أدوات Flexbox
   ===================================================== */
.flex-row { flex-direction: row !important; }
.flex-col { flex-direction: column !important; }
.flex-row-reverse { flex-direction: row-reverse !important; }
.flex-col-reverse { flex-direction: column-reverse !important; }

.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-wrap-reverse { flex-wrap: wrap-reverse !important; }

.items-start { align-items: flex-start !important; }
.items-center { align-items: center !important; }
.items-end { align-items: flex-end !important; }
.items-stretch { align-items: stretch !important; }
.items-baseline { align-items: baseline !important; }

.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.justify-around { justify-content: space-around !important; }
.justify-evenly { justify-content: space-evenly !important; }

.flex-1 { flex: 1 1 0% !important; }
.flex-auto { flex: 1 1 auto !important; }
.flex-initial { flex: 0 1 auto !important; }
.flex-none { flex: none !important; }
.flex-grow { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

/* =====================================================
   67. أدوات الموقع (Position Utilities)
   ===================================================== */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.sticky { position: sticky !important; }
.static { position: static !important; }

.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.left-0 { left: 0 !important; }
.right-0 { right: 0 !important; }

.inset-0 { top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; }

.z-10 { z-index: 10 !important; }
.z-20 { z-index: 20 !important; }
.z-50 { z-index: 50 !important; }
.z-100 { z-index: 100 !important; }

/* =====================================================
   68. أدوات العرض (Width/Height)
   ===================================================== */
.w-100 { width: 100% !important; }
.w-75 { width: 75% !important; }
.w-50 { width: 50% !important; }
.w-25 { width: 25% !important; }
.w-auto { width: auto !important; }

.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }

.min-h-screen { min-height: 100vh !important; }

.max-w-xs { max-width: 20rem !important; }
.max-w-sm { max-width: 24rem !important; }
.max-w-md { max-width: 28rem !important; }
.max-w-lg { max-width: 32rem !important; }
.max-w-xl { max-width: 36rem !important; }
.max-w-2xl { max-width: 42rem !important; }
.max-w-3xl { max-width: 48rem !important; }
.max-w-4xl { max-width: 56rem !important; }
.max-w-5xl { max-width: 64rem !important; }
.max-w-full { max-width: 100% !important; }

/* =====================================================
   69. أدوات الخلفية (Background)
   ===================================================== */
.bg-primary { background: var(--primary-color) !important; }
.bg-primary-dark { background: var(--primary-dark) !important; }
.bg-accent { background: var(--accent-color) !important; }
.bg-white { background: white !important; }
.bg-light { background: var(--lightGrey-color) !important; }
.bg-light-blue { background: var(--lightBlue-color) !important; }
.bg-success { background: var(--green-color) !important; }
.bg-danger { background: var(--red-color) !important; }
.bg-warning { background: var(--yellow-color) !important; }
.bg-info { background: var(--blue-color) !important; }

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark)) !important;
}

.bg-gradient-dark {
    background: linear-gradient(135deg, var(--ink-light), var(--ink-color)) !important;
}

.bg-transparent { background: transparent !important; }

/* =====================================================
   70. أدوات الحدود (Border Utilities)
   ===================================================== */
.border { border: 1px solid var(--border-color) !important; }
.border-0 { border: none !important; }
.border-2 { border: 2px solid var(--border-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }
.border-accent { border-color: var(--accent-color) !important; }
.border-success { border-color: var(--green-color) !important; }
.border-danger { border-color: var(--red-color) !important; }

.border-t { border-top: 1px solid var(--border-color) !important; }
.border-b { border-bottom: 1px solid var(--border-color) !important; }
.border-r { border-right: 1px solid var(--border-color) !important; }
.border-l { border-left: 1px solid var(--border-color) !important; }

.rounded-none { border-radius: 0 !important; }
.rounded-xs { border-radius: var(--radius-xs) !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: 9999px !important; }

/* =====================================================
   71. أدوات الظلال (Shadow Utilities)
   ===================================================== */
.shadow-none { box-shadow: none !important; }
.shadow-xs { box-shadow: var(--shadow-xs) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-2xl { box-shadow: var(--shadow-2xl) !important; }

/* =====================================================
   72. أدوات إضافية
   ===================================================== */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.overflow-x-auto { overflow-x: auto !important; }
.overflow-y-auto { overflow-y: auto !important; }

.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

.select-none { user-select: none !important; }
.select-text { user-select: text !important; }
.select-all { user-select: all !important; }

.opacity-0 { opacity: 0 !important; }
.opacity-25 { opacity: 0.25 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-100 { opacity: 1 !important; }

.pointer-events-none { pointer-events: none !important; }
.pointer-events-auto { pointer-events: auto !important; }

.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }

/* =====================================================
   73. Responsive — Large Screens (max 1200px)
   ===================================================== */
@media only screen and (max-width: 1200px) {
    .container { max-width: 1000px; }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

/* =====================================================
   74. Responsive — Tablets (max 1024px)
   ===================================================== */
@media only screen and (max-width: 1024px) {
    .container { max-width: 100%; }

    .grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
    .grid-stats { grid-template-columns: repeat(2, 1fr); }

    .announcement-slide { grid-template-columns: 1fr 1fr; }
    [dir="rtl"] .announcement-slide { grid-template-columns: 1fr 1fr; }

    .gpa-row { grid-template-columns: 1fr 1fr; }

    .course-stats-grid { grid-template-columns: repeat(2, 1fr); }

    .hero-slider { min-height: 60vh; }
}

/* =====================================================
   75. Responsive — Mobile (max 768px)
   ===================================================== */
@media only screen and (max-width: 768px) {
    html { font-size: 56.25%; }

    .container,
    .container-wide,
    .container-narrow { padding: 0 1.5rem; }

    /* Header */
    header { padding: 0.8rem 0; }
    header .logo { font-size: 1.8rem; }
    header .logo img { height: 48px; }

    /* Navigation */
    nav { display: none; }
    .lang-switcher { display: none; }
    .change-preferences-btn { display: none; }
    .mobile-menu-toggle { display: block; }
    .mobile-nav { display: block; }

    /* Hero */
    .hero-slider { min-height: 60vh; }
    .hero-slider .slide-content h1 { font-size: 3rem; }
    .hero-slider .slide-content p { font-size: 1.6rem; margin-bottom: 2rem; }
    .hero-slider .slide-content .btn-group { flex-direction: column; }
    .hero-slider .slide-content .btn-group .btn { width: 100%; }
    .slider-arrows { padding: 0 1rem; }
    .slider-arrows button { width: 40px; height: 40px; font-size: 1.6rem; }
    .slider-nav { bottom: 1.5rem; }

    /* Announcement */
    .announcement-slider { min-height: auto; }
    .announcement-slide {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        position: relative;
    }
    [dir="rtl"] .announcement-slide { grid-template-columns: 1fr; }
    .announcement-slide-image {
        min-height: 200px;
        order: 1 !important;
    }
    .announcement-slide-image::before {
        background: linear-gradient(180deg, transparent 60%, rgba(255, 255, 255, 0.9) 100%);
    }
    [dir="rtl"] .announcement-slide-image::before {
        background: linear-gradient(180deg, transparent 60%, rgba(255, 255, 255, 0.9) 100%);
    }
    .announcement-slide-content {
        order: 2 !important;
        padding: 1.5rem;
    }
    .announcement-slide-content h3 { font-size: 2rem; }
    .announcement-slide-content p {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    .announcement-slider-arrows { display: none; }

    /* Grids → single column */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5,
    .grid-stats,
    .grid-auto-fit,
    .grid-auto-fill-sm,
    .grid-auto-fill-lg { grid-template-columns: 1fr; }

    /* Cards */
    .card { padding: 1.5rem; }
    .card h2 { font-size: 2rem; }

    /* Typography */
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.2rem; }
    h3 { font-size: 1.8rem; }

    /* Buttons */
    .btn { padding: 1rem 1.8rem; font-size: 1.4rem; }
    .btn-lg { padding: 1.2rem 2.4rem; font-size: 1.5rem; }
    .btn-xl { padding: 1.4rem 2.8rem; font-size: 1.6rem; }

    /* Page Header */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .page-header .btn { width: 100%; text-align: center; }

    /* Search */
    .search-container { flex-direction: column; }
    .search-input-wrapper { width: 100%; min-width: auto; }
    .search-container .btn { width: 100%; }

    /* Forms */
    .form-group input,
    .form-group select,
    .form-group textarea { padding: 1rem; }

    .form-row { grid-template-columns: 1fr; }

    /* Tables */
    table { font-size: 1.4rem; }
    th, td { padding: 1rem; }

    /* Preferences */
    .preferences-banner { flex-direction: column; text-align: center; }
    .preferences-banner-info { flex-direction: column; }
    .preferences-banner-actions { width: 100%; justify-content: center; }

    /* Modals */
    .modal-content { padding: 2rem; }
    .modal-actions { flex-direction: column; }

    /* GPA */
    .gpa-row { grid-template-columns: 1fr; }
    .gpa-result { font-size: 3.5rem; }

    /* Course Stats */
    .course-stats-grid { grid-template-columns: 1fr; }

    /* Contact */
    .contact-grid { grid-template-columns: 1fr; }

    /* Footer */
    footer { padding: 2rem 0; margin-top: 3rem; }

    /* Utilities */
    .d-none-mobile { display: none !important; }
    .d-none-desktop { display: block !important; }

    .text-4xl { font-size: 2.8rem !important; }
    .text-3xl { font-size: 2.4rem !important; }
}

/* =====================================================
   76. Responsive — Small Mobile (max 480px)
   ===================================================== */
@media only screen and (max-width: 480px) {
    html { font-size: 50%; }
    .container,
    .container-wide,
    .container-narrow { padding: 0 1rem; }

    .hero-slider .slide-content h1 { font-size: 2.4rem; }
    .hero-slider .slide-content p { font-size: 1.4rem; }

    .announcement-slide-image { min-height: 160px; }
    .announcement-slide-content { padding: 1.2rem; }
    .announcement-slide-content h3 { font-size: 1.8rem; }
    .announcement-slide-actions { flex-direction: column; }
    .announcement-slide-actions .btn { width: 100%; text-align: center; }

    .btn { padding: 0.9rem 1.2rem; font-size: 1.3rem; }
    .btn-lg { padding: 1rem 1.8rem; font-size: 1.4rem; }

    .card { padding: 1.2rem; }
    .card-actions { flex-direction: column; }
    .card-actions .btn { width: 100%; }

    .counter { font-size: 2.8rem; }
    .service-icon { width: 60px; height: 60px; font-size: 2.4rem; }
    .feature-icon { width: 52px; height: 52px; font-size: 2rem; }

    .image-modal-close { width: 4rem; height: 4rem; font-size: 2rem; }
    .modal-content { padding: 1.5rem; }
    .modal-header h2 { font-size: 2rem; }

    .gpa-result { font-size: 3rem; }
    .gpa-result-label { font-size: 1.5rem; }

    .auth-icon { width: 64px; height: 64px; font-size: 2.6rem; }

    .course-card-image { height: 140px; }
    .course-card-image i { font-size: 3rem; }
    .course-card-body { padding: 1.5rem; }

    .doctor-avatar { width: 70px; height: 70px; font-size: 2.4rem; }

    .plan-card-body { padding: 1.5rem; }

    h1 { font-size: 2.4rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.7rem; }

    .breadcrumbs { font-size: 1.2rem; gap: 0.6rem; }

    .pagination a,
    .pagination span { padding: 0.6rem 1rem; font-size: 1.3rem; min-width: 3.2rem; }

    .text-4xl { font-size: 2.4rem !important; }
    .text-3xl { font-size: 2rem !important; }
    .text-2xl { font-size: 1.8rem !important; }

    .slider-arrows { display: none; }
    .slider-nav { bottom: 1rem; }
}

/* =====================================================
   77. Responsive — Tiny Screens (max 360px)
   ===================================================== */
@media only screen and (max-width: 360px) {
    html { font-size: 47.5%; }
    .hero-slider .slide-content h1 { font-size: 2rem; }
    .btn { padding: 0.7rem 1rem; font-size: 1.2rem; }
}

/* =====================================================
   78. Landscape Orientation
   ===================================================== */
@media only screen and (max-height: 500px) and (orientation: landscape) {
    .hero-slider { min-height: 100vh; }
    .hero-slider .slide-content h1 { font-size: 2.4rem; margin-bottom: 1rem; }
    .hero-slider .slide-content p { font-size: 1.4rem; margin-bottom: 1.5rem; }
}

/* =====================================================
   79. Print Styles
   ===================================================== */
@media print {
    header,
    footer,
    nav,
    .mobile-nav,
    .mobile-overlay,
    .mobile-menu-toggle,
    .slider-arrows,
    .slider-nav,
    .btn,
    .lang-switcher,
    .change-preferences-btn { display: none !important; }

    body {
        background: white;
        font-size: 12pt;
        color: black;
        line-height: 1.5;
    }

    main { padding-top: 0; }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    .card:hover {
        box-shadow: none;
        transform: none;
    }

    a { color: black; text-decoration: underline; }
    a::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }

    h1, h2, h3 { page-break-after: avoid; }

    img { max-width: 100% !important; page-break-inside: avoid; }

    table { page-break-inside: auto; }
    tr { page-break-inside: avoid; page-break-after: auto; }

    .page-break { page-break-before: always; }
    .no-print { display: none !important; }
}

/* =====================================================
   80. Accessibility
   ===================================================== */

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-sm);
    z-index: 99999;
    text-decoration: none;
    font-weight: 600;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 1rem;
    color: white;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus Visible */
*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --grey-color: #333;
    }
    .card { border-width: 2px; }
    .btn { border-width: 2px; }
}

/* =====================================================
   81. Scrollbar
   ===================================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--lightGrey-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
    border: 2px solid var(--lightGrey-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

::-webkit-scrollbar-corner {
    background: var(--lightGrey-color);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--lightGrey-color);
}

/* =====================================================
   82. Selection
   ===================================================== */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* =====================================================
   83. Forms Autofill Fix
   ===================================================== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: var(--ink-color) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* =====================================================
   84. Placeholder Animation
   ===================================================== */
@keyframes placeholderShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.placeholder-loading {
    background: linear-gradient(90deg, var(--lightGrey-color) 25%, var(--border-light) 50%, var(--lightGrey-color) 75%);
    background-size: 200% 100%;
    animation: placeholderShimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* =====================================================
   85. Tooltip
   ===================================================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--ink-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* =====================================================
   86. Divider with Text
   ===================================================== */
.divider-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    color: var(--grey-light);
    font-size: 1.3rem;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* =====================================================
   87. Aspect Ratio
   ===================================================== */
.aspect-1-1 { aspect-ratio: 1 / 1; }
.aspect-4-3 { aspect-ratio: 4 / 3; }
.aspect-16-9 { aspect-ratio: 16 / 9; }
.aspect-2-1 { aspect-ratio: 2 / 1; }
.aspect-3-4 { aspect-ratio: 3 / 4; }

/* =====================================================
   88. Object Fit
   ===================================================== */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }
.object-fill { object-fit: fill; }
.object-none { object-fit: none; }

/* =====================================================
   89. Backdrop Blur
   ===================================================== */
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.backdrop-blur { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.backdrop-blur-lg { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* =====================================================
   90. Transform
   ===================================================== */
.transform { transform: translateZ(0); }
.scale-95 { transform: scale(0.95); }
.scale-100 { transform: scale(1); }
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }

.rotate-45 { transform: rotate(45deg); }
.rotate-90 { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }

.-translate-y-1 { transform: translateY(-0.5rem); }
.-translate-y-2 { transform: translateY(-1rem); }
.translate-y-1 { transform: translateY(0.5rem); }
.translate-y-2 { transform: translateY(1rem); }

/* =====================================================
   91. Transition Utilities
   ===================================================== */
.transition-none { transition: none !important; }
.transition-all { transition: all var(--transition) !important; }
.transition-fast { transition: all var(--transition-fast) !important; }
.transition-slow { transition: all var(--transition-slow) !important; }

.transition-colors {
    transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}

.transition-transform {
    transition: transform var(--transition);
}

/* =====================================================
   92. Hover Effects
   ===================================================== */
.hover-lift {
    transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform var(--transition);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-opacity {
    transition: opacity var(--transition);
}

.hover-opacity:hover {
    opacity: 0.8;
}

.hover-bg-primary {
    transition: background var(--transition), color var(--transition);
}

.hover-bg-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* =====================================================
   93. Container Queries (Fallback)
   ===================================================== */
@media (min-width: 1200px) {
    .hide-xl { display: none !important; }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .hide-lg { display: none !important; }
}

@media (min-width: 768px) and (max-width: 991px) {
    .hide-md { display: none !important; }
}

@media (max-width: 767px) {
    .hide-sm { display: none !important; }
}

/* =====================================================
   94. Print Specific
   ===================================================== */
.print-only { display: none; }

@media print {
    .print-only { display: block !important; }
    .no-print { display: none !important; }
}

/* =====================================================
   95. لمسات أخيرة
   ===================================================== */
html, body {
    -webkit-tap-highlight-color: transparent;
}

/* منع النسخ في العناصر الحساسة */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* النص العربي */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="number"],
[dir="rtl"] input[type="password"] {
    direction: ltr;
    text-align: right;
}

/* Smooth scrolling for anchor links */
:target {
    scroll-margin-top: 12rem;
}

/* =====================================================
   96. Focus Ring Custom
   ===================================================== */
.focus-ring:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.focus-ring-accent:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* =====================================================
   97. Notification Badges
   ===================================================== */
.badge-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red-color);
}

.badge-dot-success { background: var(--green-color); }
.badge-dot-warning { background: var(--yellow-color); }
.badge-dot-info { background: var(--blue-color); }

/* =====================================================
   98. Separator
   ===================================================== */
.separator {
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
    border: none;
}

.separator-vertical {
    width: 1px;
    height: 2rem;
    background: var(--border-color);
    display: inline-block;
    margin: 0 1rem;
    vertical-align: middle;
}

/* =====================================================
   99. Colored Text Highlights
   ===================================================== */
.highlight {
    background: linear-gradient(180deg, transparent 60%, var(--accent-color) 60%);
    padding: 0 0.3rem;
    font-weight: 600;
}

.highlight-primary {
    background: var(--primary-tint-strong);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-xs);
    font-weight: 600;
}

mark {
    background: var(--accent-tint);
    color: var(--ink-color);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-xs);
}

/* =====================================================
   99.5 لوحة الإعلانات (Announcements Board)
   ===================================================== */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.announcement-card {
    text-align: right;
}

.announcement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.announcement-date {
    color: var(--grey-color);
    font-size: 1.3rem;
}

.announcement-title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.announcement-media {
    margin: 1.5rem 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.announcement-media img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-sm);
}

.announcement-body {
    font-size: 1.6rem;
    line-height: 1.9;
    color: var(--ink-light);
}

/* =====================================================
   100. End of Styles
   ===================================================== */

/* 
   =====================================================
   ملخص الملف:
   - Part 1: 28 قسم — الأساسيات (المتغيرات، Header، Cards، Buttons...)
   - Part 2: 32 قسم — المكونات (Hero، Course Card، Modal...)
   - Part 3: 40 قسم — الأدوات والاستجابة
   =====================================================
*/

/* =====================================================
   لوحة الإعلانات
   ===================================================== */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto 4rem;
}
.announcement-card { padding: 2.4rem; }
.announcement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}
.announcement-date { font-size: 1.3rem; color: var(--grey-color); }
.announcement-title { font-size: 2rem; color: var(--primary-color); margin-bottom: 1.2rem; }
.announcement-media { margin: 1.2rem 0; }
.announcement-media img, .announcement-media video {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--lightGrey-color);
}
.announcement-body { font-size: 1.6rem; line-height: 1.9; color: var(--ink-color); }

/* =====================================================
   ألوان اللوجو: أخضر مزرق (أساسي) + بنفسجي داكن (ثانوي) + رمادي (محايد)
   التوزيع: الأخضر للعناوين والأزرار الرئيسية، البنفسجي للفوتر والتمييز، الرمادي للنصوص والخلفيات
   كل مربع بلون واحد ثابت بدون تدرّج
   ===================================================== */
:root {
    --purple: #5e4560;
    --purple-dark: #4a3449;
    --purple-deep: #34232f;
    --purple-tint: #5e45601a;
    --grey-tint: #6f70731a;
}

footer { background: var(--purple-dark); }
footer::before { background: var(--primary-color); }

.card-gradient,
.cta-section,
.course-detail-header,
.bg-gradient-primary {
    background: var(--primary-color) !important;
}
.bg-gradient-accent { background: var(--purple) !important; }
.bg-gradient-dark { background: var(--grey-color) !important; }

/* عنوان الهيرو: "طريقك للـ A" بخلفية بيضاء ونص بنفسجي ليكون واضحاً */
.hero-slider .slide-content h1 span {
    display: inline-block;
    background: #ffffff;
    color: var(--purple);
    padding: 0 1.4rem;
    border-radius: 12px;
    margin-inline-start: 0.6rem;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 64px;
    height: 4px;
    margin: 1rem auto 0;
    border-radius: 4px;
    background: var(--purple);
}

/* توزيع دوري: أخضر ← بنفسجي ← رمادي */
.grid > .card:nth-child(3n+1) .service-icon,
.grid > .card:nth-child(3n+1) .feature-icon { background: var(--primary-tint-strong); color: var(--primary-color); }
.grid > .card:nth-child(3n+2) .service-icon,
.grid > .card:nth-child(3n+2) .feature-icon { background: var(--purple-tint); color: var(--purple); }
.grid > .card:nth-child(3n) .service-icon,
.grid > .card:nth-child(3n) .feature-icon { background: var(--grey-tint); color: var(--grey-color); }
.grid > .card:nth-child(3n+1):hover .service-icon { background: var(--primary-color); color: #fff; }
.grid > .card:nth-child(3n+2):hover .service-icon { background: var(--purple); color: #fff; }
.grid > .card:nth-child(3n):hover .service-icon { background: var(--grey-color); color: #fff; }

.course-card:nth-child(3n+1) .course-card-image { background: var(--primary-tint-strong); }
.course-card:nth-child(3n+1) .course-card-image i { color: var(--primary-color); }
.course-card:nth-child(3n+2) .course-card-image { background: var(--purple-tint); }
.course-card:nth-child(3n+2) .course-card-image i { color: var(--purple); }
.course-card:nth-child(3n) .course-card-image { background: var(--grey-tint); }
.course-card:nth-child(3n) .course-card-image i { color: var(--grey-color); }

.doctor-card:nth-child(3n+1) .doctor-avatar { background: var(--primary-tint-strong); color: var(--primary-color); }
.doctor-card:nth-child(3n+2) .doctor-avatar { background: var(--purple-tint); color: var(--purple); }
.doctor-card:nth-child(3n) .doctor-avatar { background: var(--grey-tint); color: var(--grey-color); }

.plan-card-badge { background: var(--purple); }
.pagination .active { background: var(--purple); border-color: var(--purple); }
.course-stat-box:nth-child(3n+1) i { color: var(--primary-color); }
.course-stat-box:nth-child(3n+2) i { color: var(--purple); }
.course-stat-box:nth-child(3n) i { color: var(--grey-color); }
.badge-accent { background: var(--purple-tint); color: var(--purple); }
nav a:hover { color: var(--purple); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--grey-color); color: #fff; }
.btn-secondary:hover { background: var(--ink-light); }

/* =====================================================
   الشعار: أكبر وأوضح في كل الصفحات (يغلب كل التعريفات السابقة)
   ===================================================== */
header { padding: 0.5rem 0 !important; }
header .logo { gap: 1rem !important; }
header .logo .logo-img,
header .logo img {
    height: 84px !important;
    width: auto !important;
    max-width: none !important;
    object-fit: contain !important;
    mix-blend-mode: normal !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}
@media only screen and (max-width: 768px) {
    header .logo .logo-img,
    header .logo img { height: 56px !important; }
}
@media only screen and (max-width: 480px) {
    header .logo .logo-img,
    header .logo img { height: 50px !important; }
}

/* =====================================================
   النسخة الإنجليزية (LTR)
   ===================================================== */
html[dir="ltr"] body,
html[dir="ltr"] th,
html[dir="ltr"] td,
html[dir="ltr"] .announcement-card { text-align: left; }
html[dir="ltr"] .text-center, html[dir="ltr"] [style*="text-align:center"] { text-align: center; }
html[dir="ltr"] i[style*="margin-left"] { margin-left: 0 !important; margin-right: 0.8rem !important; }
html[dir="ltr"] .auth-card input[type="email"],
html[dir="ltr"] .auth-card input[type="password"],
html[dir="ltr"] input[type="url"],
html[dir="ltr"] input[type="tel"],
html[dir="ltr"] input[type="number"] { text-align: left; }

/* شريط التنقل: أضيق قليلاً لإتاحة مساحة للشعار الأكبر والنصوص الإنجليزية الأطول */
@media only screen and (min-width: 769px) and (max-width: 1450px) {
    header nav { gap: 0.2rem !important; }
    header nav > a { padding: 0.8rem 0.9rem !important; font-size: 1.35rem !important; }
    header nav .change-preferences-btn { padding: 0.8rem 1rem !important; font-size: 1.25rem !important; }
    header nav .lang-switcher { padding-left: 0.5rem !important; }
    header nav .lang-switcher a { padding: 0.8rem 1rem !important; }
    header .logo span { font-size: 1.7rem !important; }
}
html[dir="ltr"] header nav > a { padding: 0.8rem 0.9rem !important; font-size: 1.35rem !important; }
html[dir="ltr"] header nav .change-preferences-btn { padding: 0.8rem 1rem !important; font-size: 1.25rem !important; }
html[dir="ltr"] header nav .lang-switcher { padding-left: 0 !important; padding-right: 0 !important; margin-left: 0.5rem; border-left: 1px solid var(--border-color); border-right: none; }
header nav .change-preferences-btn { white-space: nowrap !important; }
html[dir="ltr"] header nav > a { padding: 0.8rem 0.75rem !important; }
html[dir="ltr"] header nav > a { padding: 0.8rem 0.6rem !important; font-size: 1.3rem !important; }
html[dir="ltr"] header nav .change-preferences-btn { padding: 0.7rem 0.8rem !important; font-size: 1.2rem !important; }
html[dir="ltr"] header .logo span { font-size: 1.6rem !important; }
@media only screen and (min-width: 769px) and (max-width: 1180px) {
    header .container { flex-wrap: wrap; row-gap: 0.4rem; }
    header nav { flex-wrap: wrap !important; justify-content: flex-end; }
}

/* =====================================================
   الهيدر: الشعار والقائمة قريبان من الحواف + قائمة "إضافات مميزة"
   ===================================================== */
header { background: rgba(250, 250, 250, 0.95) !important; }
header .container { max-width: none !important; padding-inline: 1.6rem !important; }

.nav-dropdown { position: relative; }
header nav .nav-dd-toggle {
    display: inline-flex; align-items: center; gap: 0.7rem;
    padding: 0.9rem 1.6rem; border-radius: var(--radius-sm);
    background: transparent; color: var(--grey-color);
    font: inherit; font-size: 1.5rem; font-weight: 600; white-space: nowrap;
    border: 2px solid transparent; cursor: pointer; transition: all var(--transition);
}
header nav .nav-dd-toggle i { font-size: 1.1rem; transition: transform .2s; }
header nav .nav-dd-toggle:hover,
header nav .nav-dd-toggle.active,
.nav-dropdown.open .nav-dd-toggle {
    background: var(--primary-tint); color: var(--primary-color); border-color: var(--primary-tint-strong);
}
.nav-dropdown.open .nav-dd-toggle i { transform: rotate(180deg); }
.nav-dd-menu {
    display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 230px;
    background: #fff; border: 1px solid var(--border-color); border-radius: 18px; padding: 0.7rem;
    box-shadow: 0 18px 40px -16px rgba(46, 47, 50, 0.35); z-index: 1100; margin-top: 8px;
}
.nav-dd-menu::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.nav-dropdown.open .nav-dd-menu { display: block; }
@media (hover: hover) { .nav-dropdown:hover .nav-dd-menu { display: block; } }
header nav .nav-dd-menu a {
    display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; border-radius: 12px;
    color: var(--ink-color); font-size: 1.45rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
header nav .nav-dd-menu a i { width: 22px; text-align: center; color: var(--primary-color); }
header nav .nav-dd-menu a:nth-child(2) i { color: var(--purple); }
header nav .nav-dd-menu a:nth-child(3) i { color: var(--grey-color); }
header nav .nav-dd-menu a:hover,
header nav .nav-dd-menu a.active { background: var(--primary-tint); color: var(--primary-color); transform: none; }

.mobile-group { border-bottom: 1px solid var(--lightGrey-color); }
.mobile-group-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 1.3rem 1rem; background: transparent; border: 0; cursor: pointer;
    font: inherit; font-size: 1.6rem; font-weight: 600; color: var(--ink-color); text-align: start;
}
.mobile-group-toggle.active, .mobile-group-toggle:hover { color: var(--primary-color); }
.mobile-group-toggle i { font-size: 1.2rem; transition: transform .2s; }
.mobile-group.open .mobile-group-toggle i { transform: rotate(180deg); }
.mobile-group-links { display: none; padding-inline-start: 1.6rem; }
.mobile-group.open .mobile-group-links { display: block; }
.mobile-group-links a i { width: 24px; margin-inline-end: 0.6rem; color: var(--primary-color); }

/* روابط التواصل: البطاقة كلها قابلة للضغط */
a.contact-item { display: block; text-decoration: none; color: inherit; cursor: pointer; }
a.contact-item p { color: var(--primary-color); font-weight: 700; }
a.contact-item:hover h3 { color: var(--purple); }
a.contact-item:nth-child(2) i { color: var(--purple); }

/* القائمة ملاصقة للشعار على نفس الطرف، وزرّا "تغيير التفضيلات" و EN في الطرف المقابل */
header .container { justify-content: flex-start !important; }
header nav {
    flex: 1 1 auto !important;
    min-width: 0;
    justify-content: flex-start !important;
    margin-inline-start: 2.4rem;
}
header nav .change-preferences-btn { margin-inline-start: auto !important; }
@media (max-width: 768px) {
    header .container { justify-content: space-between !important; }
}


/* =====================================================
   Hemmeh mobile social links + night mode
   ===================================================== */
.mobile-social-links {
    display: flex;
    gap: 0.8rem;
    padding: 1.8rem 0 1rem;
    border-top: 2px solid var(--lightGrey-color);
}
.mobile-social-links a {
    flex: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 0.7rem !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm);
    background: var(--lightBlue-color);
    color: var(--grey-color) !important;
    font-size: 1.35rem !important;
}
.mobile-social-links a:hover {
    color: #fff !important;
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}
.mobile-social-links a:first-child:hover { background: #1877f2 !important; border-color: #1877f2 !important; }
.mobile-social-links a:last-child:hover { background: #d62976 !important; border-color: #d62976 !important; }
.mobile-social-links i { font-size: 1.7rem; }
.mobile-theme-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.3rem 1rem;
    border: 0;
    border-bottom: 1px solid var(--lightGrey-color);
    background: transparent;
    color: var(--ink-color);
    font: inherit;
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    text-align: start;
    transition: all var(--transition);
}
.mobile-theme-toggle:hover { color: var(--primary-color); background: var(--primary-tint); }
.mobile-theme-toggle i { width: 2rem; color: var(--accent-color); }

html[data-theme="dark"] {
    color-scheme: dark;
    --ink-color: #edf4f5;
    --ink-light: #cbd8da;
    --grey-color: #aab9bc;
    --grey-light: #8fa2a6;
    --grey-lighter: #71878c;
    --border-color: #35474c;
    --border-light: #2b3b40;
    --border-dark: #52676d;
    --lightGrey-color: #223136;
    --lightBlue-color: #1a282d;
    --white-color: #142126;
    --black-color: #ffffff;
    --primary-tint: #2b96a622;
    --primary-tint-strong: #2b96a644;
    --accent-tint: #a27aa222;
    --blue-light: #1d3547;
    --red-light: #512e33;
    --green-light: #1c4434;
    --yellow-light: #514126;
    background: #111c20;
}
html[data-theme="dark"] body { background: #111c20; color: var(--ink-color); }
html[data-theme="dark"] header,
html[data-theme="dark"] footer,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .mobile-nav,
html[data-theme="dark"] .nav-dd-menu,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .accordion-item {
    background-color: #18282d;
    color: var(--ink-color);
    border-color: var(--border-color);
}
html[data-theme="dark"] main,
html[data-theme="dark"] section:not(.hero-slider):not(.cta-section) { color: var(--ink-color); }
html[data-theme="dark"] a { color: #79d2dc; }
html[data-theme="dark"] header nav > a { color: var(--ink-color); }
html[data-theme="dark"] header nav > a:hover,
html[data-theme="dark"] .mobile-nav a:hover,
html[data-theme="dark"] .mobile-nav a.active { color: #8de3eb; }
html[data-theme="dark"] .mobile-overlay { background: rgba(0, 0, 0, 0.72); }
html[data-theme="dark"] .mobile-social-links a { background: #1f3035; }
html[data-theme="dark"] .mobile-theme-toggle { color: var(--ink-color); }
html[data-theme="dark"] .logo-img { mix-blend-mode: normal; }
html[data-theme="dark"] ::placeholder { color: #82969a; }
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-outline { color: #b7e8ed; border-color: #4b8991; }
html[data-theme="dark"] .nav-dd-menu a { color: var(--ink-color) !important; }


/* =====================================================
   Dark mode contrast system — accessible, readable, consistent
   ===================================================== */
html[data-theme="dark"] {
    --dark-bg: #0e171b;
    --dark-surface: #17262b;
    --dark-surface-raised: #1d3036;
    --dark-surface-soft: #22383f;
    --dark-text: #f1f7f8;
    --dark-text-soft: #d0e0e3;
    --dark-muted: #a9bdc2;
    --dark-muted-strong: #c1d0d3;
    --dark-line: #405960;
    --dark-line-strong: #5b747b;
    --dark-link: #8de5ef;
    --dark-focus: #71d6e1;
    --dark-success-bg: #183f35;
    --dark-success-text: #a9f0ca;
    --dark-danger-bg: #4a252c;
    --dark-danger-text: #ffc3c9;
    --dark-warning-bg: #4b3a1d;
    --dark-warning-text: #ffe0a3;
    --dark-info-bg: #1d3b52;
    --dark-info-text: #b8e5ff;
}
html[data-theme="dark"] body,
html[data-theme="dark"] main { background-color: var(--dark-bg); color: var(--dark-text); }
html[data-theme="dark"] header { background: rgba(18, 31, 36, .98) !important; border-bottom-color: var(--dark-line); }
html[data-theme="dark"] footer { background: #0b1215; color: var(--dark-text-soft); }
html[data-theme="dark"] .card,
html[data-theme="dark"] .store-card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .nav-dd-menu,
html[data-theme="dark"] .mobile-nav,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] details,
html[data-theme="dark"] .table-wrapper,
html[data-theme="dark"] .course-resource-card,
html[data-theme="dark"] .doctor-card,
html[data-theme="dark"] .plan-card,
html[data-theme="dark"] .quiz-card,
html[data-theme="dark"] .announcement-card {
    background-color: var(--dark-surface) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-line) !important;
    box-shadow: 0 12px 28px rgba(0,0,0,.22);
}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .card h1,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] .card h3,
html[data-theme="dark"] .card h4,
html[data-theme="dark"] .card h5,
html[data-theme="dark"] .card h6 { color: var(--dark-text); }
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] td,
html[data-theme="dark"] th,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card p { color: var(--dark-text-soft); }
html[data-theme="dark"] .text-grey,
html[data-theme="dark"] .text-grey-light,
html[data-theme="dark"] .field-hint,
html[data-theme="dark"] .store-desc,
html[data-theme="dark"] .announcement-date,
html[data-theme="dark"] .store-order-note,
html[data-theme="dark"] small,
html[data-theme="dark"] .muted,
html[data-theme="dark"] [class*="muted"] { color: var(--dark-muted) !important; }
html[data-theme="dark"] a { color: var(--dark-link); }
html[data-theme="dark"] a:hover { color: #c1f7fb; }
html[data-theme="dark"] nav a,
html[data-theme="dark"] header nav > a,
html[data-theme="dark"] .mobile-nav a,
html[data-theme="dark"] .mobile-group-toggle { color: var(--dark-text-soft); }
html[data-theme="dark"] label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .required { color: var(--dark-text-soft); }
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .res-tags input,
html[data-theme="dark"] .res-tags select {
    background-color: #122126 !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-line-strong) !important;
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] a:focus-visible {
    outline: 3px solid var(--dark-focus) !important;
    outline-offset: 2px;
}
html[data-theme="dark"] ::placeholder { color: #91a9ae !important; opacity: 1; }
html[data-theme="dark"] option { background: #122126; color: var(--dark-text); }
html[data-theme="dark"] hr,
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-2 { border-color: var(--dark-line) !important; }
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-ghost,
html[data-theme="dark"] .tl-btn.ghost {
    background-color: var(--dark-surface-raised) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-line-strong) !important;
}
html[data-theme="dark"] .btn-outline:hover,
html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .btn-ghost:hover { background-color: var(--dark-surface-soft) !important; color: #fff !important; }
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .tl-btn:not(.ghost) { color: #fff !important; background: #208fa0 !important; border-color: #208fa0 !important; }
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .tl-btn:not(.ghost):hover { background: #2bb5c2 !important; color: #071417 !important; }
html[data-theme="dark"] .badge,
html[data-theme="dark"] .pill { color: var(--dark-text) !important; background-color: var(--dark-surface-soft) !important; border-color: var(--dark-line) !important; }
html[data-theme="dark"] .alert-success,
html[data-theme="dark"] .store-order-message.success { background: var(--dark-success-bg) !important; color: var(--dark-success-text) !important; border-color: #3f8c70 !important; }
html[data-theme="dark"] .alert-danger,
html[data-theme="dark"] .store-order-message.error { background: var(--dark-danger-bg) !important; color: var(--dark-danger-text) !important; border-color: #a8525d !important; }
html[data-theme="dark"] .alert-warning,
html[data-theme="dark"] .pill.warn { background: var(--dark-warning-bg) !important; color: var(--dark-warning-text) !important; border-color: #98743a !important; }
html[data-theme="dark"] .alert-info { background: var(--dark-info-bg) !important; color: var(--dark-info-text) !important; border-color: #4d89ac !important; }
html[data-theme="dark"] .store-cart,
html[data-theme="dark"] .store-my-orders { background: var(--dark-surface-raised) !important; border-color: #3e9ba6 !important; }
html[data-theme="dark"] .store-fixed-option,
html[data-theme="dark"] .store-payment-number { background: #183b43 !important; color: #b6f1f4 !important; border-color: #4d9aa3 !important; }
html[data-theme="dark"] .store-cart-row,
html[data-theme="dark"] .my-order-row,
html[data-theme="dark"] .store-cart-summary { border-color: var(--dark-line) !important; }
html[data-theme="dark"] .cart-qty button,
html[data-theme="dark"] .cart-remove { background: var(--dark-surface-soft); color: var(--dark-text); border-color: var(--dark-line-strong); }
html[data-theme="dark"] .cart-remove { color: #ffabb5; }
html[data-theme="dark"] .mobile-social-links { border-color: var(--dark-line); }
html[data-theme="dark"] .mobile-social-links a { background: var(--dark-surface-raised); color: var(--dark-text-soft) !important; border-color: var(--dark-line) !important; }
html[data-theme="dark"] .mobile-theme-toggle { color: var(--dark-text-soft); border-color: var(--dark-line); }
html[data-theme="dark"] .nav-dd-menu a:hover,
html[data-theme="dark"] .mobile-nav a:hover,
html[data-theme="dark"] .mobile-nav a.active { background: #214049 !important; color: #c1f7fb !important; }
html[data-theme="dark"] .modal-overlay,
html[data-theme="dark"] .mobile-overlay { background: rgba(0,0,0,.78); }
html[data-theme="dark"] table thead,
html[data-theme="dark"] .table-header { background: #214049 !important; color: var(--dark-text) !important; }
html[data-theme="dark"] table tr,
html[data-theme="dark"] .table-row { border-color: var(--dark-line) !important; }
html[data-theme="dark"] pre,
html[data-theme="dark"] code,
html[data-theme="dark"] .code-block { background: #0a1418 !important; color: #d8f6ef !important; border-color: var(--dark-line) !important; }
html[data-theme="dark"] .empty-state-icon { color: #72cbd4 !important; }
html[data-theme="dark"] .fa-spinner { color: #7ee3ea !important; }
html[data-theme="dark"] .admin-header { background: #3f2e42 !important; }
html[data-theme="dark"] .admin-tab-btn { background: var(--dark-surface) !important; color: var(--dark-text-soft) !important; border-color: var(--dark-line) !important; }
html[data-theme="dark"] .admin-tab-btn.active,
html[data-theme="dark"] .admin-tab-btn:hover { background: #238f9e !important; color: #fff !important; border-color: #238f9e !important; }
/* Preserve intentional white text on saturated hero/stat backgrounds. */
html[data-theme="dark"] .slide-content,
html[data-theme="dark"] .slide-content h1,
html[data-theme="dark"] .slide-content p,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .stat-card h3,
html[data-theme="dark"] .stat-card p,
html[data-theme="dark"] .cta-section,
html[data-theme="dark"] .cta-section h2,
html[data-theme="dark"] .cta-section p { color: #fff !important; }



/* =====================================================
   Dark mode second pass — fix low-contrast legacy components
   ===================================================== */
html[data-theme="dark"] {
    /* Bright tokens for text and icons; button backgrounds are set separately below. */
    --primary-color: #72d7e0;
    --primary-dark: #4fb5c1;
    --primary-light: #91e5eb;
    --primary-lighter: #b5f0f3;
    --accent-color: #d4acd2;
    --accent-dark: #bd8fbb;
    --accent-light: #e0c4df;
    --purple: #d4acd2;
    --purple-dark: #4b344d;
    --purple-deep: #302235;
    --grey-color: #b6c7ca;
    --grey-light: #9fb4b8;
    --grey-lighter: #81999e;
    --cat-1: #72d7e0;
    --cat-2: #d4acd2;
    --cat-3: #b6c7ca;
}
html[data-theme="dark"] .btn,
html[data-theme="dark"] button.btn { color: #f7ffff; }
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-success,
html[data-theme="dark"] .btn-danger,
html[data-theme="dark"] .btn-accent { color: #071417 !important; }
html[data-theme="dark"] .btn-primary { background: #72d7e0 !important; border-color: #72d7e0 !important; }
html[data-theme="dark"] .btn-success { background: #65d49d !important; border-color: #65d49d !important; }
html[data-theme="dark"] .btn-danger { background: #ff8f9c !important; border-color: #ff8f9c !important; }
html[data-theme="dark"] .btn-accent { background: #d4acd2 !important; border-color: #d4acd2 !important; }
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-success:hover,
html[data-theme="dark"] .btn-danger:hover,
html[data-theme="dark"] .btn-accent:hover { color: #061013 !important; filter: brightness(1.08); }
html[data-theme="dark"] .alert-success,
html[data-theme="dark"] .badge-success { background: #183f35 !important; color: #b9f5d3 !important; }
html[data-theme="dark"] .alert-danger,
html[data-theme="dark"] .badge-danger { background: #4a252c !important; color: #ffc3c9 !important; }
html[data-theme="dark"] .alert-info,
html[data-theme="dark"] .badge-info { background: #1d3b52 !important; color: #b8e5ff !important; }
html[data-theme="dark"] .alert-warning,
html[data-theme="dark"] .badge-warning { background: #4b3a1d !important; color: #ffe0a3 !important; }
html[data-theme="dark"] .badge-primary { background: #214b53 !important; color: #a9f0f4 !important; }
html[data-theme="dark"] .badge-accent { background: #49384d !important; color: #f0d7ed !important; }
html[data-theme="dark"] .badge-dark { background: #0a1418 !important; color: #f1f7f8 !important; }
html[data-theme="dark"] .badge-light { background: #2a4046 !important; color: #d5e3e5 !important; }
html[data-theme="dark"] .search-input-wrapper input { background: #122126 !important; color: #f1f7f8 !important; border-color: #5b747b !important; }
html[data-theme="dark"] .search-input-wrapper i { color: #a9dce1 !important; }
html[data-theme="dark"] .pagination a,
html[data-theme="dark"] .pagination span { background: #22383f !important; color: #c5f0f2 !important; border-color: #526c73 !important; }
html[data-theme="dark"] .pagination .active { background: #72d7e0 !important; color: #071417 !important; border-color: #72d7e0 !important; }
html[data-theme="dark"] .pagination .disabled { color: #7e959a !important; background: #1a2a2f !important; }
html[data-theme="dark"] .divider-text { background: #0e171b !important; color: #b6c7ca !important; }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg,#1b2c31 25%,#2d454b 50%,#1b2c31 75%) !important; }
html[data-theme="dark"] .loader-overlay { background: rgba(10,20,24,.92) !important; }
html[data-theme="dark"] .placeholder { background: linear-gradient(90deg,#1b2c31 25%,#2d454b 50%,#1b2c31 75%) !important; }
html[data-theme="dark"] .hero-slider .slide-content h1 span { background: #eaf9fa !important; color: #4b344d !important; }
html[data-theme="dark"] .section-header h2::after { background: #d4acd2 !important; }
html[data-theme="dark"] .service-icon,
html[data-theme="dark"] .feature-icon,
html[data-theme="dark"] .doctor-avatar { color: #a9f0f4 !important; background: #214b53 !important; }
html[data-theme="dark"] .course-card-image { background: #214b53 !important; }
html[data-theme="dark"] .course-card-image i,
html[data-theme="dark"] .course-stat-box i { color: #a9f0f4 !important; }
html[data-theme="dark"] .plan-card-badge { background: #6a4f69 !important; color: #fff !important; }
html[data-theme="dark"] .breadcrumbs a,
html[data-theme="dark"] .breadcrumbs .current,
html[data-theme="dark"] .breadcrumbs span { color: #bfecef !important; }
html[data-theme="dark"] .form-group label { color: #d0e0e3 !important; }
html[data-theme="dark"] .form-group label.required::after { color: #ff9aa5 !important; }
html[data-theme="dark"] .nav-dd-menu { background: #17262b !important; }
html[data-theme="dark"] .nav-dd-menu a i { color: #8de5ef !important; }
html[data-theme="dark"] .contact-item p,
html[data-theme="dark"] .announcement-title { color: #8de5ef !important; }


/* Course cards and navigation states — final dark-mode polish. */
html[data-theme="dark"] .course-card {
    background: #17262b !important;
    border-color: #405960 !important;
    color: #f1f7f8 !important;
}
html[data-theme="dark"] .course-card-body { background: #17262b !important; }
html[data-theme="dark"] .course-card-title { color: #f3ffff !important; text-shadow: none !important; }
html[data-theme="dark"] .course-card-desc,
html[data-theme="dark"] .course-card-stat-label { color: #b9cccf !important; }
html[data-theme="dark"] .course-card-stats { background: #22383f !important; border: 1px solid #405960 !important; }
html[data-theme="dark"] .course-card-stat-value { color: #8de5ef !important; }
html[data-theme="dark"] .course-card .badge,
html[data-theme="dark"] .course-card .pill { background: #2a4b52 !important; color: #e5ffff !important; border-color: #4e8e97 !important; }
html[data-theme="dark"] .course-card .btn-primary { background: #72d7e0 !important; color: #071417 !important; }

/* Keep menu text white and use a blue outline with a dark translucent fill. */
html[data-theme="dark"] header nav > a:hover,
html[data-theme="dark"] header nav > a.active,
html[data-theme="dark"] header nav .nav-dd-toggle:hover,
html[data-theme="dark"] header nav .nav-dd-toggle.active,
html[data-theme="dark"] .nav-dropdown.open .nav-dd-toggle,
html[data-theme="dark"] header nav .change-preferences-btn:hover,
html[data-theme="dark"] header nav .lang-switcher a:hover {
    background: rgba(33, 64, 73, .72) !important;
    color: #ffffff !important;
    border: 2px solid #2bb5c2 !important;
    box-shadow: 0 0 0 1px rgba(43,181,194,.12), 0 5px 16px rgba(0,0,0,.16) !important;
    transform: none !important;
}
html[data-theme="dark"] header nav > a.active,
html[data-theme="dark"] header nav .nav-dd-toggle.active,
html[data-theme="dark"] .nav-dropdown.open .nav-dd-toggle { background: rgba(33, 64, 73, .58) !important; }
html[data-theme="dark"] header nav > a,
html[data-theme="dark"] header nav .nav-dd-toggle,
html[data-theme="dark"] header nav .change-preferences-btn,
html[data-theme="dark"] header nav .lang-switcher a { color: #f4ffff !important; }
html[data-theme="dark"] header nav .nav-dd-menu a:hover,
html[data-theme="dark"] header nav .nav-dd-menu a.active,
html[data-theme="dark"] .mobile-nav a:hover,
html[data-theme="dark"] .mobile-nav a.active,
html[data-theme="dark"] .mobile-group-toggle:hover,
html[data-theme="dark"] .mobile-group-toggle.active {
    background: rgba(33, 64, 73, .72) !important;
    color: #ffffff !important;
    border-color: #2bb5c2 !important;
    box-shadow: 0 0 0 1px rgba(43,181,194,.10) !important;
    transform: none !important;
    padding-right: inherit !important;
}
html[data-theme="dark"] header nav .nav-dd-menu a,
html[data-theme="dark"] .mobile-nav a,
html[data-theme="dark"] .mobile-group-toggle { color: #e6f5f6 !important; border: 1px solid transparent !important; }
html[data-theme="dark"] header nav .nav-dd-menu a:hover,
html[data-theme="dark"] header nav .nav-dd-menu a.active,
html[data-theme="dark"] .mobile-nav a:hover,
html[data-theme="dark"] .mobile-nav a.active,
html[data-theme="dark"] .mobile-group-toggle:hover,
html[data-theme="dark"] .mobile-group-toggle.active { border-color: #2bb5c2 !important; }
html[data-theme="dark"] header nav .nav-dd-menu a:hover i,
html[data-theme="dark"] header nav .nav-dd-menu a.active i { color: #a9f0f4 !important; }
html[data-theme="dark"] header nav .lang-switcher a { background: rgba(33,64,73,.58) !important; border: 2px solid transparent !important; }
html[data-theme="dark"] header nav .lang-switcher a:hover { border-color: #2bb5c2 !important; }
/* Final dark-mode fix: saturated CTA/gradient sections must not use pale cyan with white text. */
html[data-theme="dark"] .cta-section,
html[data-theme="dark"] .card-gradient,
html[data-theme="dark"] .bg-gradient-primary,
html[data-theme="dark"] .course-detail-header {
    background: #1c5963 !important;
    border: 1px solid #347984 !important;
    color: #f4ffff !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.18) !important;
}
html[data-theme="dark"] .cta-section h1,
html[data-theme="dark"] .cta-section h2,
html[data-theme="dark"] .cta-section h3,
html[data-theme="dark"] .cta-section p,
html[data-theme="dark"] .card-gradient h1,
html[data-theme="dark"] .card-gradient h2,
html[data-theme="dark"] .card-gradient h3,
html[data-theme="dark"] .card-gradient p,
html[data-theme="dark"] .bg-gradient-primary h1,
html[data-theme="dark"] .bg-gradient-primary h2,
html[data-theme="dark"] .bg-gradient-primary h3,
html[data-theme="dark"] .bg-gradient-primary p,
html[data-theme="dark"] .course-detail-header h1,
html[data-theme="dark"] .course-detail-header h2,
html[data-theme="dark"] .course-detail-header h3,
html[data-theme="dark"] .course-detail-header p { color: #f4ffff !important; }
html[data-theme="dark"] .cta-section p { color: #d5eef0 !important; }
html[data-theme="dark"] .cta-section .btn,
html[data-theme="dark"] .card-gradient .btn { background: #d4acd2 !important; border-color: #d4acd2 !important; color: #211a22 !important; }
html[data-theme="dark"] .cta-section .btn:hover,
html[data-theme="dark"] .card-gradient .btn:hover { background: #e4c3e2 !important; border-color: #e4c3e2 !important; color: #211a22 !important; }
html[data-theme="dark"] .bg-gradient-accent { background: #49384d !important; color: #f6eaf5 !important; }
html[data-theme="dark"] .bg-gradient-accent h1,
html[data-theme="dark"] .bg-gradient-accent h2,
html[data-theme="dark"] .bg-gradient-accent h3,
html[data-theme="dark"] .bg-gradient-accent p { color: #f6eaf5 !important; }
/* User-uploaded homepage/about photos: preserve the complete image, never crop. */
.site-team-photo,
#homeTeamPhoto,
#aboutTeamPhoto {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: var(--lightGrey-color);
}
html[data-theme="dark"] .site-team-photo,
html[data-theme="dark"] #homeTeamPhoto,
html[data-theme="dark"] #aboutTeamPhoto {
    background: #17262b;
}



/* الصفحة الرئيسية: أرقام صغيرة متوازنة في صف واحد على الشاشات الواسعة */
.home-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.2rem;
}
.home-stat-card {
    display: flex;
    min-width: 0;
    min-height: 150px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.4rem 1rem !important;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
}
.home-stat-icon { margin-bottom: .5rem; font-size: 2.8rem; line-height: 1.1; opacity: .92; }
.home-stat-card h3 { margin: .25rem 0; font-size: clamp(2.2rem, 2.7vw, 3.2rem); line-height: 1.15; }
.home-stat-card .stat-label { margin: .3rem 0 0; font-size: clamp(1.15rem, 1.25vw, 1.4rem); line-height: 1.4; }

/* معرض الصور أسفل الرئيسية: مساحة ثابتة ومنظمة مع إظهار الصورة كاملة دون قصّها */
.home-photo-section { margin: 3rem 0 1rem; }
.home-photo-slider {
    position: relative;
    width: min(100%, 1080px);
    height: clamp(250px, 45vw, 520px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: var(--lightGrey-color);
    box-shadow: var(--shadow-lg);
}
.home-photo-slides, .home-photo-slide { position: absolute; inset: 0; }
.home-photo-slide { opacity: 0; visibility: hidden; transition: opacity .65s ease, visibility .65s ease; }
.home-photo-slide.active { opacity: 1; visibility: visible; }
.home-photo-slide img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.home-photo-arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 50%;
    background: rgba(25, 46, 50, .72);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,.18);
}
.home-photo-prev { right: 1.4rem; }
.home-photo-next { left: 1.4rem; }
.home-photo-arrow:hover { background: var(--primary-color); }
.home-photo-dots { position: absolute; z-index: 2; right: 0; bottom: 1.2rem; left: 0; display: flex; justify-content: center; gap: .7rem; }
.home-photo-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.68); cursor: pointer; box-shadow: 0 1px 5px rgba(0,0,0,.35); transition: transform .2s ease, background .2s ease; }
.home-photo-dot.active { transform: scale(1.3); background: #fff; }
html[data-theme="dark"] .home-photo-slider { border-color: #30474c; background: #17262b; }

@media (max-width: 1024px) {
    .home-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .home-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
    .home-stat-card { min-height: 132px; padding: 1.1rem .7rem !important; }
    .home-stat-icon { font-size: 2.4rem; }
    .home-photo-section { margin-top: 2rem; }
    .home-photo-slider { height: clamp(230px, 68vw, 360px); border-radius: var(--radius-lg); }
    .home-photo-arrow { width: 36px; height: 36px; }
    .home-photo-prev { right: .8rem; }
    .home-photo-next { left: .8rem; }
}

/* ===== زر العرض الليلي في شريط التنقل (الشاشات الكبيرة) — بجانب زر اللغة ===== */
@media only screen and (min-width: 769px) {
    header nav .lang-switcher { display: flex; align-items: center; gap: 0.6rem; }
}
header nav .lang-switcher .theme-toggle-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 4rem; height: 4rem; padding: 0; cursor: pointer;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    background: transparent; color: var(--primary-color);
    font-size: 1.6rem; line-height: 1;
    transition: all var(--transition);
}
header nav .lang-switcher .theme-toggle-btn:hover {
    border-color: var(--primary-color); background: var(--primary-tint);
}
header nav .lang-switcher .theme-toggle-btn:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }
html[data-theme="dark"] header nav .lang-switcher .theme-toggle-btn {
    background: rgba(33,64,73,.58); color: #ffd96b; border: 2px solid transparent;
}
html[data-theme="dark"] header nav .lang-switcher .theme-toggle-btn:hover { border-color: #2bb5c2; }

/* ===== صفحة الخطط الدراسية: اختيار الدفعة ===== */
.plans-cohort-chips { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 2.4rem; justify-content: center; }
.plans-chip { font-family: inherit; font-size: 1.5rem; font-weight: 700; padding: .8rem 2rem; border-radius: 999px; cursor: pointer; border: 2px solid var(--border-color); background: var(--white-color); color: var(--primary-color); transition: all .2s ease; }
.plans-chip:hover { border-color: var(--primary-color); background: var(--primary-tint); }
.plans-chip:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }
.plans-chip.active { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
.plans-empty { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; font-size: 1.6rem; color: var(--grey-color); }

/* ===== صفحة المادة: مجموعات المحتوى كقوائم مطوية ===== */
.res-group { border: 2px solid var(--border-color); border-radius: var(--radius-sm); background: var(--white-color); margin-bottom: 1.2rem; overflow: hidden; }
.res-group-head { list-style: none; display: flex; align-items: center; gap: 1rem; padding: 1.4rem 1.6rem; cursor: pointer; user-select: none; font-size: 1.7rem; font-weight: 700; color: var(--primary-color); transition: background .2s ease; }
.res-group-head::-webkit-details-marker { display: none; }
.res-group-head::marker { content: ""; }
.res-group-head:hover { background: var(--primary-tint); }
.res-group-head:focus-visible { outline: 3px solid var(--accent-color); outline-offset: -3px; }
.res-group-title { flex: 1; }
.res-group-count { min-width: 3rem; padding: .2rem 1rem; border-radius: 999px; text-align: center; font-size: 1.3rem; font-weight: 700; background: var(--primary-tint-strong); color: var(--primary-color); }
.res-group-chev { font-size: 1.3rem; transition: transform .25s ease; }
.res-group[open] > .res-group-head { border-bottom: 2px solid var(--border-color); }
.res-group[open] > .res-group-head .res-group-chev { transform: rotate(180deg); }
.res-group-body { padding: 1.4rem 1.4rem .2rem; }


/* ===== لوحة الأدمن: إدارة قوائم وملفات المواد ===== */
.adm-list { margin-bottom: 1.8rem; }
.adm-list-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 .8rem; font-size: 1.5rem; color: var(--primary-color); }
.adm-list-tools { margin-inline-start: auto; display: flex; gap: .6rem; flex-wrap: wrap; }
.adm-res-tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.course-info-form { margin: 1.2rem 0; padding: 1.2rem; border: 2px dashed var(--border-color); border-radius: var(--radius-sm); }
.course-info-form .grid-2 { gap: 1rem; }

/* ===== إصلاح العرض الليلي: بطاقات بيضاء ثابتة كان نصها فاتحاً فلا يُقرأ ===== */
html[data-theme="dark"] .course-stat-box,
html[data-theme="dark"] .contact-item,
html[data-theme="dark"] .featured-course,
html[data-theme="dark"] .filter-bar,
html[data-theme="dark"] .announcement-slider,
html[data-theme="dark"] .announcement-slide-content,
html[data-theme="dark"] .tl-card,
html[data-theme="dark"] .pr-header,
html[data-theme="dark"] .pr-tabs {
    background: var(--dark-surface) !important;
    border-color: var(--dark-line) !important;
}
html[data-theme="dark"] .tl-card,
html[data-theme="dark"] .pr-header,
html[data-theme="dark"] .pr-tabs {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -16px rgba(0, 0, 0, .65) !important;
}

/* حقول وأزرار صفحات الأدوات (بومودورو/المهام) */
html[data-theme="dark"] .tl-input {
    background: var(--dark-surface-soft) !important;
    color: var(--dark-text) !important;
    border-color: var(--dark-line) !important;
}
html[data-theme="dark"] .tl-input:focus { border-color: var(--dark-focus) !important; }
html[data-theme="dark"] .pm-icon-btn {
    background: var(--dark-surface-soft);
    color: var(--dark-text-soft);
    border-color: var(--dark-line);
}
html[data-theme="dark"] .pm-icon-btn:hover {
    color: var(--pm-color);
    border-color: var(--pm-color);
    background: var(--pm-tint);
}

/* صفوف قالب قائمة المهام */
html[data-theme="dark"] .sheet-row { background: var(--dark-surface-soft); }

/* صندوق نص البرومبت (وتدرج التلاشي أسفله) */
html[data-theme="dark"] .pr-box { background: var(--dark-surface-soft); border-color: var(--dark-line); }
html[data-theme="dark"] .pr-box:not(.open).long::after {
    background: linear-gradient(to bottom, rgba(34, 56, 63, 0), #22383f 78%);
}

/* بطاقات مكتبة البرومبت (النص، الوسوم، المؤلف، النوافذ، رسائل النموذج) */
html[data-theme="dark"] .pr-text { color: var(--dark-text-soft); }
html[data-theme="dark"] .pr-more { background: var(--dark-surface); color: var(--dark-link); }
html[data-theme="dark"] .pr-tag { background: var(--dark-surface-soft); color: var(--dark-muted-strong); }
html[data-theme="dark"] .pr-author { color: var(--dark-text-soft); }
html[data-theme="dark"] .pr-author .pr-cohort { background: var(--dark-surface-soft); color: var(--dark-muted-strong); }
html[data-theme="dark"] .pr-modal-close { background: var(--dark-surface-soft); color: var(--dark-text-soft); }
html[data-theme="dark"] .pr-field label,
html[data-theme="dark"] .pr-check { color: var(--dark-text-soft); }
html[data-theme="dark"] .pr-form-msg.ok { background: var(--dark-success-bg); color: var(--dark-success-text); }
html[data-theme="dark"] .pr-form-msg.err { background: var(--dark-danger-bg); color: var(--dark-danger-text); }

/* إجابات الاختبار */
html[data-theme="dark"] .quiz-answer { background: var(--dark-surface-soft); border-color: var(--dark-line); color: var(--dark-text); }
html[data-theme="dark"] .quiz-answer:hover,
html[data-theme="dark"] .quiz-answer.selected { background: var(--primary-tint-strong); border-color: var(--primary-color); }
html[data-theme="dark"] .quiz-answer.correct { background: var(--dark-success-bg); border-color: var(--dark-success-text); color: var(--dark-success-text); }
html[data-theme="dark"] .quiz-answer.wrong { background: var(--dark-danger-bg); border-color: var(--dark-danger-text); color: var(--dark-danger-text); }

/* رابط English بقائمة الجوال: نص أبيض على خلفية فيروزية فاتحة لا يُقرأ */
html[data-theme="dark"] .mobile-nav .mobile-lang-switcher a { background: #18788a; color: #fff !important; }

/* ===== الشعار الأبيض في العرض الليلي (الرمز فقط بدون الكتابة) ===== */
html[data-theme="dark"] header .logo .logo-img,
html[data-theme="dark"] header .logo img,
html[data-theme="dark"] .sheet-logo img {
    content: url("logo-mark-white.png");
    filter: none !important;
}
