/* ============================================
   امتثال - منصة تقييم الامتثال للأمن السيبراني
   Modern Security Interface Design System
   ============================================ */

/* Typography - خطوط عربية مميزة */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Harmattan:wght@400;700&display=swap');

/* ============================================
   CSS Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Design System - CSS Variables
   ============================================ */
:root {
    /* Primary Color Palette - Emerald Green Theme */
    --color-emerald-50: #ecfdf5;
    --color-emerald-100: #d1fae5;
    --color-emerald-200: #a7f3d0;
    --color-emerald-300: #6ee7b7;
    --color-emerald-400: #34d399;
    --color-emerald-500: #10b981;
    --color-emerald-600: #059669;
    --color-emerald-700: #047857;
    --color-emerald-800: #065f46;
    --color-emerald-900: #064e3b;

    /* Accent Colors - Mint & Teal */
    --color-mint-400: #5eead4;
    --color-mint-500: #2dd4bf;
    --color-mint-600: #14b8a6;
    --color-teal-500: #14b8a6;
    --color-teal-600: #0d9488;
    --color-teal-700: #0f766e;

    /* Semantic Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;

    /* Neutral Palette */
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;

    /* Gradients - Premium Feel */
    --gradient-emerald: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    --gradient-mint: linear-gradient(135deg, #6ee7b7 0%, #34d399 50%, #10b981 100%);
    --gradient-teal: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 50%, #0d9488 100%);
    --gradient-radial: radial-gradient(circle at 30% 20%, rgba(16, 185, 129, 0.5), rgba(5, 150, 105, 0.5), rgba(4, 120, 87, 0.5));
    --gradient-mesh:
        radial-gradient(at 40% 20%, rgba(16, 185, 129, 0.03) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(52, 211, 153, 0.03) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(110, 231, 183, 0.02) 0px, transparent 50%),
        radial-gradient(at 80% 50%, rgba(5, 150, 105, 0.02) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(16, 185, 129, 0.02) 0px, transparent 50%),
        radial-gradient(at 80% 100%, rgba(52, 211, 153, 0.02) 0px, transparent 50%);

    /* Glass Morphism Effects */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-bg-strong: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(16, 185, 129, 0.1);
    --glass-backdrop: blur(20px);

    /* Shadows - Layered Depth */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 8px rgba(16, 185, 129, 0.08);
    --shadow-md: 0 4px 16px rgba(16, 185, 129, 0.12);
    --shadow-lg: 0 10px 30px rgba(16, 185, 129, 0.15);
    --shadow-xl: 0 20px 50px rgba(16, 185, 129, 0.2);
    --shadow-2xl: 0 25px 60px -12px rgba(16, 185, 129, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.3);

    /* Typography Scale */
    --font-display: 'Cairo', sans-serif;
    --font-body: 'IBM Plex Sans Arabic', sans-serif;
    --font-accent: 'Harmattan', sans-serif;

    --text-xs: 0.75rem;
    /* 12px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-base: 1rem;
    /* 16px */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.25rem;
    /* 20px */
    --text-2xl: 1.5rem;
    /* 24px */
    --text-3xl: 1.875rem;
    /* 30px */
    --text-4xl: 2.25rem;
    /* 36px */
    --text-5xl: 3rem;
    /* 48px */
    --text-6xl: 3.75rem;
    /* 60px */
    --text-7xl: 4.5rem;
    /* 72px */

    /* Spacing Scale */
    --space-1: 0.25rem;
    /* 4px */
    --space-2: 0.5rem;
    /* 8px */
    --space-3: 0.75rem;
    /* 12px */
    --space-4: 1rem;
    /* 16px */
    --space-5: 1.25rem;
    /* 20px */
    --space-6: 1.5rem;
    /* 24px */
    --space-8: 2rem;
    /* 32px */
    --space-10: 2.5rem;
    /* 40px */
    --space-12: 3rem;
    /* 48px */
    --space-16: 4rem;
    /* 64px */
    --space-20: 5rem;
    /* 80px */
    --space-24: 6rem;
    /* 96px */

    /* Border Radius */
    --radius-sm: 0.375rem;
    /* 6px */
    --radius-md: 0.5rem;
    /* 8px */
    --radius-lg: 0.75rem;
    /* 12px */
    --radius-xl: 1rem;
    /* 16px */
    --radius-2xl: 1.5rem;
    /* 24px */
    --radius-3xl: 2rem;
    /* 32px */
    --radius-full: 9999px;

    /* Animation Timing */
    --transition-fast: 150ms;
    --transition-base: 250ms;
    --transition-slow: 350ms;
    --transition-slower: 500ms;
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Z-Index Layers */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 1000;
    --z-toast: 2000;
    --z-tooltip: 3000;
}

/* ============================================
   Base Body Styles
   ============================================ */
body {
    font-family: var(--font-body);
    background: var(--color-slate-50);
    color: var(--color-slate-800);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Clean Minimal Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: -1;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-8);
}

.container-wide {
    max-width: 1536px;
    margin: 0 auto;
    padding: 0 var(--space-8);
}

.container-narrow {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--space-8);
}

/* ============================================
   Header - Glass Morphism Navigation
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    transition: all var(--transition-base) var(--ease-smooth);
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base) var(--ease-smooth);
}

.header.elevated::before {
    background: var(--glass-bg-strong);
    box-shadow: var(--shadow-md);
    border-bottom-color: var(--color-emerald-200);
}

.header-container {
    max-width: 1536px;
    margin: 0 auto;
    padding: 0 var(--space-8);
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 85px;
    position: relative;
}

/* Logo Design */
.logo-group {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: transform var(--transition-base) var(--ease-smooth);
}

.logo-group:hover {
    transform: translateX(-5px);
}

.logo-mark {
    width: 56px;
    height: 56px;
    background: transparent;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-emerald-600);
    font-weight: 800;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    transition: all var(--transition-base) var(--ease-bounce);
    padding: 0;
}

.logo-mark::before {
    content: none;
}

@keyframes logoShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(0deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.logo-group:hover .logo-mark {
    transform: rotate(0deg) scale(1.05);
    box-shadow: none;
}

.logo-mark .logo-svg-icon {
    width: 100%;
    height: 100%;
    padding: 4px;
}


.logo-text {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 900;
    background: var(--gradient-emerald);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-family: var(--font-accent);
    font-size: var(--text-sm);
    color: var(--color-slate-600);
    font-weight: 400;
    margin-top: -2px;
}

/* Header Disclaimer Button (محسن بشكل جمالي) */
.header-disclaimer-btn {
    background: rgba(255, 255, 255, 0.5);
    /* شبه شفاف */
    border: 1px solid var(--color-slate-200);
    color: var(--color-slate-600);
    padding: 0.6rem 1.25rem;
    /* مساحة داخلية مريحة */
    border-radius: var(--radius-full);
    /* شكل كبسولة */
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(8px);
    /* تأثير الزجاج */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.header-disclaimer-btn:hover {
    background: white;
    border-color: var(--color-emerald-300);
    color: var(--color-emerald-700);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
    /* توهج أخضر ناعم */
}

.header-disclaimer-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}


/* ============================================
   Hero Section - Clean Minimal Design
   ============================================ */
.hero {
    padding: calc(85px + var(--space-24)) 0 var(--space-24);
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: white;
}

/* Subtle Decorative Element - Single Clean Accent */
.hero-decoration {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.hero-decoration:nth-child(1) {
    top: -200px;
    right: -100px;
}

.hero-decoration:nth-child(2) {
    bottom: -200px;
    left: -100px;
}

.hero-decoration:nth-child(3) {
    display: none;
    /* Remove third decoration */
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-8);
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-12);
}

.hero-text h1 {
    font-family: var(--font-display);
    font-size: clamp(var(--text-4xl), 5vw, var(--text-7xl));
    font-weight: 900;
    color: var(--color-slate-900);
    line-height: 1.15;
    margin-bottom: var(--space-6);
    letter-spacing: -0.03em;
    animation: fadeInUp 0.8s var(--ease-smooth) forwards;
    opacity: 0;
}

.hero-text h1 span {
    background: var(--gradient-mint);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.hero-text h1 span::after {
    /* **إرجاع الخط الأخضر** */
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 4px;
    /* إرجاع الارتفاع الأصلي */
    background: var(--gradient-mint);
    border-radius: var(--radius-full);
    opacity: 0.3;
    /* إرجاع الشفافية الأصلية */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-description {
    font-family: var(--font-body);
    font-size: clamp(var(--text-lg), 2vw, var(--text-2xl));
    color: var(--color-slate-600);
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto var(--space-12);
    animation: fadeInUp 0.8s var(--ease-smooth) 0.2s forwards;
    opacity: 0;
}

/* Statistics Cards - Clean Minimal Design */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    margin-bottom: var(--space-12);
    flex-wrap: wrap;
    animation: fadeInUp 0.8s var(--ease-smooth) 0.4s forwards;
    opacity: 0;
}

.stat-item {
    background: white;
    border: 2px solid var(--color-slate-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6) var(--space-8);
    min-width: 160px;
    text-align: center;
    transition: all var(--transition-base) var(--ease-smooth);
    position: relative;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-emerald-500);
    transform: scaleX(0);
    transition: transform var(--transition-base) var(--ease-smooth);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-item:hover {
    transform: translateY(-4px);
    border-color: var(--color-emerald-500);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.stat-item:hover::before {
    transform: scaleX(1);
}

.stat-number {
    font-family: var(--font-display);
    font-size: var(--text-5xl);
    font-weight: 900;
    background: var(--gradient-emerald);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-2);
    display: block;
}

.stat-label {
    font-size: var(--text-base);
    color: var(--color-slate-600);
    font-weight: 600;
}

/* CTA Button - Clean Design */
.cta-button {
    background: var(--color-emerald-600);
    color: white;
    border: none;
    padding: var(--space-5) var(--space-12);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-smooth);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s var(--ease-smooth) 0.6s forwards;
    opacity: 0;
    letter-spacing: -0.01em;
}

.cta-button:hover {
    background: var(--color-emerald-700);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button:disabled {
    background: var(--color-slate-300);
    cursor: not-allowed;
    color: var(--color-slate-600);
    box-shadow: none;
    transform: none;
    opacity: 0.8;
}

/* **NEW: Secondary CTA Button (for Save Draft/Resume)** */
.secondary-cta-button {
    background: white;
    color: var(--color-slate-700);
    border: 2px solid var(--color-slate-300);
    box-shadow: none;
    font-size: var(--text-lg); /* أصغر قليلاً من الأساسي */
    padding: var(--space-4) var(--space-8);
    font-weight: 600;
}

.secondary-cta-button:hover:not(:disabled) {
    background: var(--color-slate-100);
    color: var(--color-emerald-700);
    border-color: var(--color-emerald-300);
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.secondary-cta-button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ============================================
   Assessment Section - Clean Layout
   ============================================ */
.assessment-section {
    padding: var(--space-20) 0;
    background: var(--color-slate-50);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(var(--text-3xl), 3vw, var(--text-5xl));
    font-weight: 900;
    color: var(--color-slate-900);
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

.section-description {
    font-size: var(--text-xl);
    color: var(--color-slate-600);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Assessment Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--space-8);
}

/* Added style for the custom features grid to ensure 3 columns */
.features-grid-custom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 columns for desktop */
    gap: var(--space-8);
}

.feature-card .card-icon-wrapper {
    background: var(--color-mint-50);
    color: var(--color-teal-700);
    box-shadow: none;
}

/* End of new features grid styles */

/* Clean Assessment Card Design */
.assessment-card {
    background: white;
    border: 2px solid var(--color-slate-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base) var(--ease-smooth);
    cursor: pointer;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Top Accent Line */
.assessment-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-emerald-500);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base) var(--ease-smooth);
}

.assessment-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-emerald-500);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.15);
}

.assessment-card.selected {
    border: 2px solid var(--color-emerald-500);
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.2);
}

.assessment-card.selected::before {
    transform: scaleX(1);
    height: 4px;
}

/* Card Header */
.card-header {
    padding: var(--space-8) var(--space-8) 0;
    position: relative;
}

/* Icon with Clean Background */
.card-icon-wrapper {
    width: 72px;
    height: 72px;
    background: var(--color-emerald-50);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: var(--space-5);
    position: relative;
    transition: all var(--transition-base) var(--ease-smooth);
}

.assessment-card:hover .card-icon-wrapper {
    transform: scale(1.05);
    background: var(--color-emerald-100);
}

.card-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--color-slate-900);
    margin-bottom: var(--space-3);
    letter-spacing: -0.01em;
}

/* Card Body */
.card-body {
    padding: 0 var(--space-8) var(--space-8);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-description {
    font-size: var(--text-base);
    color: var(--color-slate-600);
    line-height: 1.7;
    margin-bottom: var(--space-6);
}

/* Card Meta - Footer */
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-slate-200);
}

.questions-count {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-slate-700);
}

.questions-count span:first-child {
    font-size: var(--text-lg);
}

.reference-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-emerald-600);
    text-decoration: none;
    transition: all var(--transition-fast) var(--ease-smooth);
}

.reference-link:hover {
    color: var(--color-emerald-700);
    gap: var(--space-3);
}

.action-section {
    text-align: center;
    margin-top: var(--space-10);
    display: flex;
    justify-content: center;
    gap: var(--space-4);
}

/* ============================================
   Questions Section - Interactive Quiz
   ============================================ */
.assessment-interface {
    padding: var(--space-8) 0;
}

.assessment-grid-container {
    display: grid;
    /* تخطيط عمود واحد على الهاتف، سيتم تغييره في الميديا كويري */
    grid-template-columns: 1fr;
    gap: var(--space-8);
    align-items: flex-start;
    /* لضمان أن العناصر تبدأ من الأعلى */
}

/* Sidebar for Progress */
.progress-sidebar {
    /* على الهواتف، الشريط يظهر ككتلة عادية في الأعلى */
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
}

.progress-container {
    background: white;
    border: 2px solid var(--color-slate-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-10);
    box-shadow: var(--shadow-md);
    position: relative;
    top: auto;
    z-index: 100;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    /* Added for responsiveness */
}

.progress-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-slate-900);
    flex-basis: 100%;
    /* Take full width on small screens */
    margin-bottom: var(--space-4);
    /* Add space below title */
}

.progress-stats {
    display: flex;
    gap: var(--space-8);
    font-size: var(--text-sm);
    color: var(--color-slate-600);
    flex-grow: 1;
    /* Allow stats to take remaining space */
    justify-content: flex-end;
    /* Align stats to the end */
}

.progress-stat {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.progress-stat-icon {
    font-size: var(--text-lg);
    color: var(--color-emerald-500);
    /* Highlight icons */
}

/* Added styles for progress-info structure */
.progress-info {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.progress-number {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--color-emerald-700);
    line-height: 1;
}

.progress-label {
    font-size: var(--text-sm);
    color: var(--color-slate-600);
    font-weight: 500;
    white-space: nowrap;
}


/* Progress Bar */
.progress-bar-container {
    position: relative;
    height: 12px;
    background: var(--color-slate-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-emerald);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Questions Container */
.questions-main-content {
    min-width: 0;
    /* مهم لمرونة الشبكة */
}

/* NEW: Styles for Info Input Section */
.info-input-section {
    background: white;
    border: 2px solid var(--color-emerald-200);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-10);
    box-shadow: var(--shadow-md);
}

.info-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--color-emerald-700);
    margin-bottom: var(--space-2);
}

.info-description {
    font-size: var(--text-lg);
    color: var(--color-slate-600);
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-slate-200);
}

.info-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-slate-700);
    margin-bottom: var(--space-2);
}

.input-group input[type="text"] {
    width: 100%;
    padding: var(--space-4);
    border: 2px solid var(--color-slate-300);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    color: var(--color-slate-900);
    transition: all 0.3s ease;
    background: var(--color-slate-50);
}

.input-group input[type="text"]:focus {
    border-color: var(--color-emerald-500);
    box-shadow: 0 0 0 3px var(--color-emerald-100);
    background: white;
    outline: none;
}
/* END NEW INPUT SECTION STYLES */


.category-section {
    margin-bottom: var(--space-10);
    padding: var(--space-6);
    background: var(--color-emerald-50);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-emerald-200);
    box-shadow: var(--shadow-sm);
}

.category-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--color-emerald-200);
}

.category-header span {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--color-emerald-800);
    letter-spacing: -0.01em;
}

.category-icon {
    font-size: var(--text-3xl);
    color: var(--color-emerald-600);
}

/* Question Card - Clean */
.question-card {
    background: white;
    border: 2px solid var(--color-slate-200);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-base) var(--ease-smooth);
}

.question-card:hover {
    box-shadow: var(--shadow-sm);
}

.question-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.question-number {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 900;
    color: var(--color-emerald-500);
    flex-shrink: 0;
    margin-left: var(--space-4);
}

.question-content {
    flex: 1;
}

.question-title {
    font-family: var(--font-display);
    font-size: clamp(var(--text-xl), 2vw, var(--text-3xl));
    font-weight: 700;
    color: var(--color-slate-900);
    line-height: 1.4;
    margin-bottom: var(--space-4);
}

.question-description {
    font-size: var(--text-base);
    color: var(--color-slate-600);
    line-height: 1.7;
    margin-bottom: var(--space-3);
}

.question-example {
    background: linear-gradient(135deg, var(--color-slate-50), var(--color-slate-100));
    border-right: 4px solid var(--color-emerald-500);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-sm);
    color: var(--color-slate-700);
    line-height: 1.6;
    margin-top: var(--space-4);
    margin-bottom: var(--space-6);
}

.question-example strong {
    color: var(--color-emerald-700);
    font-weight: 700;
}

/* Answer Options - Clean Rating Scale */
.answer-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.answer-option {
    background: white;
    border: 2px solid var(--color-slate-200);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-3);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-smooth);
    position: relative;
    user-select: none;
    /* منع تحديد النص */
}

/* إخفاء زر الراديو الأصلي */
.answer-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* تطبيق تأثير التحديد عند النقر */
.answer-option:hover {
    transform: translateY(-2px);
    border-color: var(--color-emerald-500);
}

/* التأثير عند التحديد الفعلي */
.answer-option.selected {
    background: var(--color-emerald-600);
    border-color: var(--color-emerald-700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.answer-score {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 900;
    color: var(--color-slate-700);
    margin-bottom: var(--space-2);
    transition: color var(--transition-base) var(--ease-smooth);
    display: block;
    /* لضمان ظهور النقاط بشكل واضح */
}

.answer-option.selected .answer-score {
    color: white;
}

.answer-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-slate-600);
    transition: color var(--transition-base) var(--ease-smooth);
    display: block;
    /* لضمان ظهور العنوان بشكل واضح */
}

.answer-option.selected .answer-label {
    color: var(--color-emerald-100);
}


/* Navigation Buttons Container */
.question-navigation {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-10);
}

/* Navigation Buttons - Clean */
.nav-button {
    flex: 1;
    max-width: 200px;
    background: white;
    border: 2px solid var(--color-slate-300);
    color: var(--color-slate-700);
    padding: var(--space-4) var(--space-6);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.nav-button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--color-emerald-500);
    color: var(--color-emerald-700);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-button.primary {
    background: var(--color-emerald-600);
    border-color: var(--color-emerald-600);
    color: white;
}

.nav-button.primary:hover:not(:disabled) {
    background: var(--color-emerald-700);
    border-color: var(--color-emerald-700);
    transform: translateY(-2px);
}

/* **NEW: Assessment Action Section (Buttons Container)** */
.action-section-assessment {
    /* هنا يتم التعديل لضمان التباعد بين الزرين ومحاذاة زر "احسب النتائج" لليمين (بداية RTL) */
    display: flex;
    justify-content: flex-end; /* ليدفع الزرين نحو اليمين (نهاية الحاوية) */
    gap: var(--space-4); /* تباعد ثابت بين الأزرار */
    margin-top: var(--space-10);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-slate-200);
}

/* ============================================
   Results Dashboard - Clean View
   ============================================ */
.results-dashboard {
    padding: var(--space-20) 0;
    background: var(--color-slate-50);
}

/* Results Hero Section - Clean */
.results-hero {
    text-align: center;
    margin-bottom: var(--space-16);
    padding: var(--space-12) 0;
    position: relative;
}

.results-title {
    font-family: var(--font-display);
    font-size: clamp(var(--text-4xl), 4vw, var(--text-6xl));
    font-weight: 900;
    color: var(--color-slate-900);
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

.results-subtitle {
    font-size: var(--text-xl);
    color: var(--color-slate-600);
    margin-bottom: var(--space-12);
}

/* Score Container */
.score-container {
    display: flex;
    justify-content: center;
    gap: var(--space-12);
    flex-wrap: wrap;
    margin-bottom: var(--space-16);
}

/* Score Display - Clean */
.score-circle-wrapper {
    background: white;
    border: 2px solid var(--color-slate-200);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.score-circle {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    /* تم استبدال الخلفية بخلفية بيضاء مع SVG لتمثيل التقدم */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto var(--space-8);
}

.score-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-circle-bg {
    stroke: var(--color-slate-200);
    fill: none;
    stroke-width: 20;
}

.score-circle-progress {
    stroke: var(--color-emerald-500);
    fill: none;
    stroke-width: 20;
    stroke-dasharray: 565.48;
    /* (2 * PI * 90) */
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1s ease-in-out;
}

.score-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.score-percentage {
    font-family: var(--font-display);
    font-size: var(--text-6xl);
    font-weight: 900;
    background: var(--gradient-emerald);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-2);
}

.score-label {
    font-size: var(--text-lg);
    color: var(--color-slate-600);
    font-weight: 600;
}

.score-status {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-emerald-700);
    margin-bottom: var(--space-3);
}

.score-description {
    font-size: var(--text-base);
    color: var(--color-slate-600);
    line-height: 1.7;
    max-width: 280px;
}

/* NEW: تنسيق صندوق الشرح الوصفي */
.card-description-box {
    margin-top: var(--space-6);
    padding: var(--space-4);
    background: var(--color-slate-50);
    border-radius: var(--radius-lg);
    border-right: 4px solid var(--color-emerald-500);
    text-align: right;
}

.card-description-box p {
    font-size: var(--text-sm);
    color: var(--color-slate-700);
    line-height: 1.6;
    margin: 0;
}

.card-description-box strong {
    color: var(--color-emerald-700);
}

.card-description-text {
    font-size: var(--text-sm);
    color: var(--color-slate-700);
    line-height: 1.6;
    margin: 0;
}

/* END NEW */

/* Summary Cards - Clean */
.score-details.summary-cards {
    /* Adjust alignment for score details */
    align-self: flex-start;
}

.summary-cards {
    background: white;
    border: 2px solid var(--color-slate-200);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-sm);
    flex: 1;
    max-width: 480px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-8);
}

.summary-item {
    text-align: center;
    padding: var(--space-6);
    background: linear-gradient(135deg, var(--color-slate-50), white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-slate-200);
}

.summary-value {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 900;
    background: var(--gradient-emerald);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-2);
}

.summary-label {
    font-size: var(--text-sm);
    color: var(--color-slate-600);
    font-weight: 600;
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    /* UPDATE: Increased minmax width to ensure cards are wider on large screens */
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-16);
}

/* Analysis Cards - Clean */
.analysis-card {
    background: white;
    border: 2px solid var(--color-slate-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base) var(--ease-smooth);
}

.analysis-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-emerald-500);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.category-name {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-slate-900);
}

/* -----------------------------------------------
   تنسيق تحليل الفئات (Category Analysis Styling)
   ----------------------------------------------- */
.categories-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    /* تقليل التباعد بين العناصر لـ 12px */
    padding-top: var(--space-4);
    transition: opacity 0.3s ease-in-out;
}

/* NEW: Insight message below category analysis (Expanded Padding/Margin) */
#category-analysis-insight {
    background: var(--color-slate-50);
    border-right: 4px solid var(--color-info);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-slate-700);
    margin-bottom: var(--space-6);
    /* زيادة المسافة قبل القائمة */
    transition: opacity 0.3s ease-in-out;
    line-height: 1.6;
}

#category-analysis-insight strong {
    color: var(--color-info);
}


/* NEW: Compact category item styling */
.category-item-compact {
    padding: var(--space-3) 0;
    /* زيادة الحشو (Padding) رأسي لتحسين القراءة */
    margin-bottom: var(--space-3);
    /* زيادة التباعد بين العناصر */
}

.category-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    font-family: var(--font-body);
    /* استخدام خط الجسم للقراءة */
}

.category-info .category-name {
    font-size: var(--text-base);
    /* تكبير طفيف لاسم الفئة */
    font-weight: 600;
    transition: color 0.3s ease-in-out;
}

/* NEW: Text Colors based on performance */
.category-info .category-name.danger-text,
.category-info .category-score.danger-text {
    color: var(--color-danger);
    font-weight: 700;
}

.category-info .category-name.success-text,
.category-info .category-score.success-text {
    color: var(--color-emerald-700);
}


.category-info .category-score {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    /* إزالة الخلفية المدمجة واستخدام اللون ليتوافق مع الشريط */
    color: var(--color-emerald-700);
    transition: color 0.3s ease-in-out;
}

.category-bar {
    height: 8px;
    background: var(--color-slate-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

/* NEW: Progress bar colors */
.category-fill {
    height: 100%;
    /* اللون الافتراضي (الأخضر) */
    background: var(--gradient-emerald);
    border-radius: var(--radius-full);
    transition: width 1s var(--ease-smooth), background 0.3s ease-in-out;
}

.category-fill.danger-fill {
    /* اللون الأحمر للمناطق الضعيفة (أقل من 50%) */
    background: linear-gradient(135deg, var(--color-danger) 0%, #cc3333 100%);
}

.category-fill.success-fill {
    /* اللون الأخضر للمناطق الجيدة (50% فأكثر) */
    background: var(--gradient-emerald);
}


/* Separator style for the summary view */
.category-separator {
    text-align: center;
    margin: var(--space-8) 0;
    /* زيادة المسافة حول الفاصل */
    position: relative;
}

.category-separator::before,
.category-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    /* زيادة عرض الخطوط الأفقية */
    height: 1px;
    background: var(--color-slate-300);
}

.category-separator::before {
    right: 0;
}

.category-separator::after {
    left: 0;
}

.separator-text {
    font-size: var(--text-sm);
    color: var(--color-slate-500);
    background: white;
    padding: 0 var(--space-4);
    position: relative;
    z-index: 1;
}

/* -----------------------------------------------
   End: تنسيق تحليل الفئات
   ----------------------------------------------- */

/* Category Progress Bar (re-used for category-bar/category-fill in JS logic) */
.category-progress {
    height: 10px;
    background: var(--color-slate-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-6);
}

.category-progress-fill {
    height: 100%;
    background: var(--gradient-emerald);
    border-radius: var(--radius-full);
    transition: width 1s var(--ease-smooth);
}

.category-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

.category-stat {
    text-align: center;
    padding: var(--space-4);
    background: linear-gradient(135deg, var(--color-slate-50), white);
    border-radius: var(--radius-lg);
}

.stat-value {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-emerald-600);
    line-height: 1;
    margin-bottom: var(--space-1);
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--color-slate-600);
    font-weight: 600;
}

/* -----------------------------------------------
   New: Performance Insights Styling (for compact results)
   ----------------------------------------------- */
.insights-container {
    display: flex;
    flex-direction: column;
    /* Stacked on mobile */
    gap: var(--space-6);
    /* زيادة التباعد بين البطاقات */
    padding: var(--space-4) 0;
}

.insight-group {
    background: white;
    /* تم التعديل إلى خلفية بيضاء ليكون داخل البطاقة الرئيسية */
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--color-slate-200);
}

.strong-areas {
    border-right: 4px solid var(--color-success);
}

.weak-areas {
    border-right: 4px solid var(--color-danger);
}

.insight-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px dashed var(--color-slate-300);
}

.insight-title.success-color {
    color: var(--color-success);
}

.insight-title.danger-color {
    color: var(--color-danger);
}

.insight-icon {
    font-size: var(--text-xl);
}

.insight-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.insight-list li {
    font-size: var(--text-base);
    color: var(--color-slate-700);
    line-height: 1.8;
    padding: var(--space-1) 0;
    padding-right: var(--space-5);
    position: relative;
    font-weight: 500;
}

.insight-list li::before {
    content: '•';
    position: absolute;
    right: 0;
    color: var(--color-emerald-500);
    font-weight: 900;
    font-size: 1.2em;
}

.weak-areas .insight-list li::before {
    content: '✗';
    color: var(--color-danger);
}

.no-insight {
    font-style: italic;
    color: var(--color-slate-500) !important;
}

/* Desktop: Side-by-side for insights */
@media (min-width: 768px) {
    .insights-container {
        flex-direction: row;
        gap: var(--space-8);
        /* زيادة التباعد بين البطاقات */
    }

    .insight-group {
        flex: 1;
        /* إضافة الحد الأدنى من العرض لضمان عدم الانكماش في الشاشات الأضيق قليلاً */
        min-width: 48%;
    }
}

/* -----------------------------------------------
   End: Performance Insights Styling
   ----------------------------------------------- */

/* Recommendations Section - Clean */
.recommendations-section {
    background: white;
    border: 2px solid var(--color-slate-200);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    margin-bottom: var(--space-12);
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--color-slate-900);
    margin-bottom: var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.section-title::before {
    content: '💡';
    font-size: var(--text-4xl);
}

/* -----------------------------------------------
   New: Priority Matrix (Impact vs Effort) Styles (UI)
   ----------------------------------------------- */
.priority-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2x2 grid on desktop */
    grid-template-rows: auto auto;
    gap: var(--space-8);
    background: var(--color-slate-100);
    /* خلفية خفيفة للمصفوفة بالكامل */
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    border: 1px solid var(--color-slate-200);
    box-shadow: var(--shadow-sm);
}

.matrix-quadrant {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--color-slate-200);
    min-height: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
}

.quadrant-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 800;
    padding-bottom: var(--space-3);
    border-bottom: 2px solid;
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.quadrant-subtitle {
    font-size: var(--text-sm);
    color: var(--color-slate-600);
    margin-bottom: var(--space-6);
    line-height: 1.6;
    flex-shrink: 0;
}

/* Quadrant Specific Colors */
.quick-wins-title {
    color: var(--color-success);
    border-bottom-color: var(--color-emerald-300);
}

.strategic-projects-title {
    color: var(--color-info);
    border-bottom-color: var(--color-info);
}

.routine-tasks-title {
    color: var(--color-slate-600);
    border-bottom-color: var(--color-slate-300);
}

.low-priority-title {
    color: var(--color-danger);
    border-bottom-color: var(--color-danger);
}

/* Recommendation Card inside Matrix */
.recommendations-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    flex-grow: 1;
    /* للسماح للبطاقات بأخذ المساحة المتاحة */
}

.recommendation-card {
    background: linear-gradient(135deg, var(--color-slate-50), white);
    border-right: 4px solid var(--color-emerald-500);
    border-radius: var(--radius-lg);
    /* أصغر قليلاً لتناسب الشبكة */
    padding: var(--space-4);
    /* أصغر قليلاً لتناسب الشبكة */
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    transition: all var(--transition-base) var(--ease-smooth);
    box-shadow: var(--shadow-xs);
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.recommendation-card.priority-high {
    border-right-color: var(--color-danger);
}

.recommendation-card.priority-medium {
    border-right-color: var(--color-warning);
}

.recommendation-card.priority-low {
    border-right-color: var(--color-emerald-500);
}

.recommendation-icon {
    width: 32px;
    /* أصغر قليلاً */
    height: 32px;
    /* أصغر قليلاً */
    background: var(--color-emerald-500);
    border-radius: var(--radius-md);
    /* أصغر قليلاً */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    flex-shrink: 0;
    color: white;
}

.recommendation-content {
    flex: 1;
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-1);
    flex-wrap: wrap;
}

/* New Badges for Impact/Effort */
.impact-badge,
.effort-badge {
    font-size: var(--text-xs);
    font-weight: 700;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    text-transform: capitalize;
    letter-spacing: 0.05em;
    color: white;
}

/* Impact Badge Colors */
.recommendation-card .impact-badge {
    background: var(--color-emerald-600);
    /* Impact high/low default */
}

.recommendation-card.priority-high {
    /* أثر عالي */
    border-right-color: var(--color-danger);
}

.quick-wins .recommendation-card .impact-badge,
.strategic-projects .recommendation-card .impact-badge {
    background: var(--color-danger);
}

.routine-tasks .recommendation-card .impact-badge,
.low-priority .recommendation-card .impact-badge {
    background: var(--color-warning);
}


/* Effort Badge Colors */
.recommendation-card .effort-badge {
    background: var(--color-slate-500);
}

.recommendation-text {
    font-size: var(--text-sm);
    /* أصغر قليلاً */
    color: var(--color-slate-700);
    line-height: 1.5;
}

.empty-quadrant {
    font-size: var(--text-base);
    color: var(--color-slate-500);
    padding: var(--space-6);
    text-align: center;
    border: 1px dashed var(--color-slate-300);
    border-radius: var(--radius-md);
    margin-top: var(--space-4);
}

/* -----------------------------------------------
   End: Priority Matrix Styles (UI)
   ----------------------------------------------- */

/* Export Section - Clean */
.export-section {
    background: white;
    border: 2px solid var(--color-slate-200);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    text-align: center;
    margin-bottom: var(--space-12);
}

.export-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--color-slate-900);
    margin-bottom: var(--space-3);
}

.export-description {
    font-size: var(--text-base);
    color: var(--color-slate-600);
    margin-bottom: var(--space-10);
}

.export-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* Export Buttons - Clean */
.export-button {
    background: white;
    border: 2px solid var(--color-slate-300);
    color: var(--color-slate-700);
    padding: var(--space-4) var(--space-8);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 700;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-smooth);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 160px;
    justify-content: center;
}

.export-button:hover {
    transform: translateY(-2px);
    border-color: var(--color-emerald-500);
    color: var(--color-emerald-700);
}

.export-button.primary {
    background: var(--color-emerald-600);
    border-color: var(--color-emerald-600);
    color: white;
}

.export-button.primary:hover {
    background: var(--color-emerald-700);
    border-color: var(--color-emerald-700);
    transform: translateY(-2px);
}

/* Action Section */
.action-section {
    text-align: center;
}

/* ============================================
   Footer - Clean (تعديل لترتيب أفضل)
   ============================================ */
.footer {
    background: white;
    border-top: 2px solid var(--color-slate-200);
    padding: var(--space-12) 0 var(--space-6);
    margin-top: var(--space-20);
    text-align: center;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* **تعديل: تقريب نص امتثال من اللوجو وإزالة الفاصل الأخضر** */
.footer-logo-group {
    /* تم تعديل display: flex; -> display: block; في HTML للتوسيط الرأسي */
    margin-bottom: var(--space-4);
    /* تقليل المسافة أسفل المجموعة */
}

/* تم حذف .compliance-separator هنا لأنه لم يعد ضرورياً في التنسيق الرأسي */
/* **نهاية التعديل** */

.footer-text {
    font-size: var(--text-base);
    color: var(--color-slate-600);
    margin-bottom: var(--space-6);
    line-height: 1.7;
    max-width: 600px;
}

.footer-disclaimer {
    border: 1px solid var(--color-danger);
    background-color: rgba(239, 68, 68, 0.1);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    max-width: 600px;
    margin: 0 auto var(--space-6);
    font-size: var(--text-sm);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    /* تقليل التباعد الأساسي */
    flex-wrap: wrap;
    margin-top: var(--space-4);
}

.footer-link {
    font-size: var(--text-sm);
    font-weight: 600;
    /* **التعديل هنا:** تحويل لون الروابط إلى الأخضر للموقع */
    color: var(--color-emerald-700);
    text-decoration: none;
    transition: all var(--transition-fast) var(--ease-smooth);
    padding: 0 var(--space-2);
    /* مسافة داخلية للروابط */
    position: relative;
    /* **إضافة الفاصل الطولي الأسود** */
}

.footer-link:not(:last-child)::after {
    content: '|';
    position: absolute;
    left: calc(var(--space-2) * -1);
    /* وضع الفاصل على يسار الرابط */
    color: var(--color-slate-900);
    /* لون الفاصل أسود */
    font-weight: 400;
}

.footer-link:hover {
    color: var(--color-emerald-700);
    text-decoration: underline;
}

/* ============================================
   Modal - Disclaimer
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: var(--space-8);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base) var(--ease-smooth);
}

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

.modal-content {
    background: white;
    border-radius: var(--radius-3xl);
    padding: var(--space-12);
    max-width: 600px;
    width: 100%;
    box-shadow: var(--shadow-2xl);
    transform: scale(0.9);
    transition: transform var(--transition-base) var(--ease-bounce);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--color-slate-900);
}

.modal-body {
    margin-bottom: var(--space-10);
}

.modal-body ul {
    list-style: none;
    padding: 0;
}

.modal-body li {
    padding: var(--space-3) 0;
    padding-right: var(--space-6);
    position: relative;
    font-size: var(--text-base);
    color: var(--color-slate-700);
    line-height: 1.7;
}

.modal-body li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--color-emerald-600);
    font-weight: 900;
}

.modal-footer {
    text-align: center;
}

.modal-button {
    background: var(--gradient-emerald);
    color: white;
    border: none;
    padding: var(--space-5) var(--space-12);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-smooth);
    box-shadow: var(--shadow-lg);
    width: 100%;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ============================================
   PDF Template Styles
   ============================================ */
.pdf-template-enhanced {
    display: none;
    /* يجب أن يكون مخفياً في العرض العادي */
    background: white;
    padding: 0;
    /* إزالة الحشو ليتحكم فيه html2pdf margin */
    width: 210mm;
    /* عرض A4 */
    font-family: var(--font-body);
    font-size: 11px;
    /* تعيين خط أساسي أصغر لـ PDF */
}

.pdf-content {
    max-width: 100%;
}

/* PDF Header */
.pdf-header-enhanced {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid var(--color-emerald-500);
}

.pdf-logo-enhanced {
    font-size: 48px;
    margin-bottom: 20px;
}

.pdf-title-enhanced {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 900;
    color: var(--color-emerald-700);
    margin-bottom: 10px;
}

.pdf-subtitle-enhanced {
    font-size: 14px;
    color: var(--color-slate-600);
    margin-bottom: 5px;
}

.pdf-date-time {
    font-size: 12px;
    color: var(--color-slate-500);
    margin-top: 15px;
}

/* PDF Score Section */
.pdf-score-section-enhanced {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    align-items: center;
}

.pdf-score-visual {
    flex-shrink: 0;
}

.pdf-score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    /* يتم تعيين الخلفية بـ JS باستخدام conic-gradient */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* إضافة حدود رمادية خفيفة للخلفية */
    border: 1px solid var(--color-slate-200);
}

.pdf-score-circle::before {
    content: '';
    position: absolute;
    inset: 15px;
    border-radius: 50%;
    background: white;
}

.pdf-score-inner {
    position: relative;
    text-align: center;
}

.pdf-score-percentage {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 900;
    color: var(--color-emerald-700);
    line-height: 1;
    margin-bottom: 5px;
}

.pdf-score-label {
    font-size: 12px;
    color: var(--color-slate-600);
    font-weight: 600;
}

.pdf-score-details {
    flex: 1;
}

.pdf-status-enhanced {
    margin-bottom: 20px;
}

.pdf-status-badge {
    display: inline-block;
    background: var(--color-emerald-500);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
}

/* PDF Status Colors (for the badge) */
.pdf-status-badge.ممتاز {
    background: var(--color-success);
}

.pdf-status-badge.جيد-جداً {
    background: var(--color-emerald-600);
}

.pdf-status-badge.جيد {
    background: var(--color-info);
}

.pdf-status-badge.مقبول {
    background: var(--color-warning);
}

.pdf-status-badge.يحتاج-تحسين {
    background: var(--color-danger);
}


.pdf-status-description {
    font-size: 13px;
    color: var(--color-slate-600);
    line-height: 1.6;
}

/* NEW: صندوق الشرح التفصيلي لـ PDF */
.pdf-card-description-box {
    margin-top: 10px;
    padding: 10px 15px;
    background: var(--color-slate-50);
    border-radius: 8px;
    border-right: 4px solid var(--color-emerald-500);
    text-align: right;
}

/* تغيير لون الشريط الجانبي لوصف التحليل والتوصيات */
#pdf-analysis-description {
    border-right-color: var(--color-info) !important;
}

#pdf-recommendations-description {
    border-right-color: var(--color-emerald-600) !important;
}
/* END NEW */


.pdf-assessment-info-enhanced {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    /* منع الالتفاف داخل عناصر grid */
    flex-wrap: nowrap;
}

.pdf-info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--color-slate-50);
    border-radius: 8px;
    font-size: 12px;
}

.pdf-info-label {
    color: var(--color-slate-600);
    font-weight: 600;
}

.pdf-info-value {
    color: var(--color-slate-900);
    font-weight: 700;
}

/* PDF Sections */
.pdf-section-enhanced {
    margin-bottom: 40px;
    /* تحكم في فواصل الصفحات لضمان عدم قص المحتوى */
    page-break-inside: avoid;
    /* محاولة منع كسر هذا القسم */
    page-break-after: auto;
}

.pdf-section-title-enhanced {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--color-slate-900);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-emerald-500);
}

/* PDF Categories */
.pdf-categories-enhanced {
    display: grid;
    gap: 20px;
}

.pdf-category-card {
    background: var(--color-slate-50);
    border-radius: 12px;
    padding: 20px;
    border-right: 4px solid var(--color-emerald-500);
    page-break-inside: avoid;
}

/* Category specific colors for PDF */
.pdf-category-card .danger-fill {
    background: linear-gradient(135deg, var(--color-danger) 0%, #cc3333 100%);
}

.pdf-category-card .danger-text {
    color: var(--color-danger);
}

.pdf-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pdf-category-name-enhanced {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-slate-900);
}

.pdf-category-score-enhanced {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 900;
    color: var(--color-emerald-600);
}

.pdf-category-progress-enhanced {
    height: 8px;
    background: var(--color-slate-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.pdf-category-progress-fill-enhanced {
    height: 100%;
    background: var(--color-emerald-500);
    border-radius: 4px;
}

.pdf-category-insights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.pdf-insight-item {
    text-align: center;
}

.pdf-insight-value {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-emerald-600);
    line-height: 1;
    margin-bottom: 5px;
}

.pdf-insight-label {
    font-size: 10px;
    color: var(--color-slate-600);
    font-weight: 600;
}

/* PDF Recommendations (Impact vs Effort Matrix Styles) */

.pdf-priority-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 15px;
    background: var(--color-slate-100);
    border-radius: 12px;
    padding: 15px;
    page-break-inside: avoid;
}

.pdf-matrix-quadrant {
    background: white;
    border: 1px solid var(--color-slate-200);
    border-radius: 10px;
    padding: 15px;
    page-break-inside: avoid;
}

/* Top border colors for quadrants */
.pdf-matrix-quadrant.quick-wins {
    border-top: 4px solid var(--color-success);
}

.pdf-matrix-quadrant.strategic-projects {
    border-top: 4px solid var(--color-info);
}

.pdf-matrix-quadrant.routine-tasks {
    border-top: 4px solid var(--color-slate-500);
}

.pdf-matrix-quadrant.low-priority {
    border-top: 4px solid var(--color-danger);
}


.pdf-quadrant-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    color: var(--color-slate-900);
    margin-bottom: 5px;
}

.pdf-quadrant-subtitle {
    font-size: 10px;
    color: var(--color-slate-600);
    margin-bottom: 10px;
}

.pdf-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pdf-recommendation-card {
    border: 1px solid var(--color-slate-200);
    border-radius: 8px;
    padding: 10px;
    background: var(--color-slate-50);
    page-break-inside: avoid;
}

.pdf-recommendation-content-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    /* منع الالتفاف لضمان ظهور الـ badges */
    flex-wrap: nowrap;
}

.pdf-rec-impact-badge,
.pdf-rec-effort-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    line-height: 1;
    flex-shrink: 0;
}

/* Badge Colors based on logic */
.pdf-rec-impact-badge.high-impact {
    background: var(--color-danger);
}

.pdf-rec-impact-badge.low-impact {
    background: var(--color-emerald-600);
}

.pdf-rec-effort-badge.high-effort {
    background: var(--color-slate-800);
}

.pdf-rec-effort-badge.low-effort {
    background: var(--color-slate-500);
}

.pdf-recommendation-icon {
    font-size: 14px;
    /* Emoji size */
}

.pdf-recommendation-text {
    font-size: 11px;
    line-height: 1.4;
    color: var(--color-slate-700);
}

.pdf-empty-quadrant {
    font-size: 11px;
    color: var(--color-slate-500);
    text-align: center;
    padding: 10px;
    border: 1px dashed var(--color-slate-300);
    border-radius: 6px;
}


/* PDF Disclaimer */
.pdf-disclaimer-enhanced {
    background: #fff3cd;
    border: 2px solid #ffd60a;
    border-right: 4px solid var(--color-warning);
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    page-break-inside: avoid;
}

.pdf-disclaimer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.pdf-disclaimer-icon {
    font-size: 24px;
}

.pdf-disclaimer-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-slate-900);
}

.pdf-disclaimer-text {
    font-size: 11px;
    color: var(--color-slate-700);
    line-height: 1.6;
    margin-bottom: 10px;
}

/* PDF Footer */
.pdf-footer-enhanced {
    text-align: center;
    margin-top: 40px;
    padding: 25px;
    background: var(--gradient-emerald);
    color: white;
    border-radius: 12px;
    page-break-inside: avoid;
}

.pdf-footer-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}

.pdf-footer-text {
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 8px;
    opacity: 0.95;
}

.pdf-footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.pdf-footer-link {
    font-size: 10px;
    opacity: 0.9;
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base) var(--ease-smooth);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-emerald-400);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-8);
}

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

.loading-text {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.loading-subtext {
    font-size: var(--text-base);
    opacity: 0.8;
    margin-bottom: var(--space-8);
}

.loading-progress-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress-fill {
    height: 100%;
    background: var(--color-emerald-400);
    border-radius: 2px;
    animation: progressLoad 2s ease infinite;
}

@keyframes progressLoad {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* ============================================
   Toast Notification - Clean
   ============================================ */
.toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    background: white;
    border: 2px solid var(--color-emerald-500);
    color: var(--color-slate-900);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transform: translateY(120px);
    opacity: 0;
    transition: all var(--transition-base) var(--ease-smooth);
    z-index: var(--z-toast);
    min-width: 280px;
    max-width: 420px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: var(--text-2xl);
    flex-shrink: 0;
}

.toast-message {
    font-weight: 600;
    font-size: var(--text-base);
    flex: 1;
}

/* -----------------------------------------------
   New Grid Layout for Assessment Interface
   ----------------------------------------------- */

/* الحاوية التي تحتوي شريط التقدم والأسئلة */
.assessment-grid-container {
    display: grid;
    /* تخطيط عمود واحد على الهاتف، سيتم تغييره في الميديا كويري */
    grid-template-columns: 1fr;
    gap: var(--space-8);
    align-items: flex-start;
    /* لضمان أن العناصر تبدأ من الأعلى */
}

/* الشريط الجانبي (Progress Sidebar) */
.progress-sidebar {
    /* على الهواتف، الشريط يظهر ككتلة عادية في الأعلى */
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
}

.progress-sidebar .progress-container {
    margin-bottom: 0;
    /* إزالة المسافة السفلية الزائدة */
}

/* محتوى الأسئلة الرئيسي */
.questions-main-content {
    min-width: 0;
    /* مهم لمرونة الشبكة */
}


/* ============================================
   Responsive Design (تعديل بسيط ليتوافق مع features-grid-custom)
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --space-24: 4rem;
        --space-20: 3rem;
    }

    .hero {
        min-height: auto;
        padding: calc(85px + var(--space-16)) 0 var(--space-16);
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-4);
    }

    .stat-item {
        width: 100%;
        max-width: 300px;
    }

    .features-grid-custom {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        /* 2 columns on tablet */
    }


    .score-container {
        flex-direction: column;
        gap: var(--space-8);
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    /* Matrix Mobile View: Stacks the 4 quadrants vertically */
    .priority-matrix {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        padding: var(--space-6);
    }

    .matrix-quadrant {
        min-height: auto;
    }
}

/* -----------------------------------------------
   Desktop/Tablet Specific Layout (Grid & Sticky)
   ----------------------------------------------- */
@media (min-width: 1024px) {
    .assessment-grid-container {
        /* تقسيم إلى عمودين: 1/4 للشريط الجانبي و 3/4 للأسئلة */
        grid-template-columns: 320px 1fr;
        padding-top: var(--space-12);
    }

    .progress-sidebar {
        /* تثبيت الشريط الجانبي على أجهزة سطح المكتب */
        position: sticky;
        top: calc(85px + var(--space-8));
        /* ثبته أسفل الهيدر بمسافة بسيطة */
        padding-top: 0;
        padding-bottom: 0;
    }

    .progress-sidebar .progress-container {
        /* تعديلات على الإحصائيات لتكون عمودية أو مدمجة */
        padding: var(--space-6);
        /* تم دمج شريط التقدم والإحصائيات في عمود واحد */
    }

    /* تعديل تنسيق الإحصائيات داخل الشريط الجانبي ليكونوا رأسيين أو أفقيين ضيقين */
    .progress-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-stats {
        flex-direction: column;
        /* جعل الإحصائيات عمودية */
        gap: var(--space-4);
        justify-content: flex-start;
        align-items: flex-start;
        flex-grow: 0;
        width: 100%;
        padding-top: var(--space-4);
        border-top: 1px solid var(--color-slate-200);
        margin-top: var(--space-4);
    }

    .progress-title {
        text-align: right;
        flex-basis: auto;
        margin-bottom: var(--space-4);
    }

    .progress-stat {
        /* تأكد من أن كل إحصائية تشغل عرضها وتكون متباعدة */
        width: 100%;
        justify-content: space-between;
    }
    
    /* لضمان ظهور زر الحفظ وزر الحساب بشكل جيد على الديسكتوب */
    .action-section-assessment {
        justify-content: flex-end; /* الزرين على اليمين */
    }
}

@media (max-width: 768px) {
    :root {
        --text-7xl: 3rem;
        --text-6xl: 2.5rem;
        --text-5xl: 2rem;
        --text-4xl: 1.75rem;
        --space-24: 3rem;
        --space-20: 2.5rem;
        --space-16: 2rem;
        --space-12: 1.5rem;
    }

    .container,
    .container-wide,
    .container-narrow {
        padding: 0 var(--space-4);
    }

    .header-container {
        padding: 0 var(--space-4);
    }

    .header-content {
        height: 65px;
    }

    .logo-mark {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .logo-text {
        font-size: var(--text-lg);
    }

    .logo-subtitle {
        font-size: var(--text-xs);
        display: none;
    }

    /* تعديل زر إخلاء المسؤولية للجوال */
    .header-disclaimer-btn {
        padding: 0.4rem 0.6rem;
        font-size: var(--text-xs);
        gap: 0.25rem;
    }

    .header-disclaimer-btn span[style*="font-size"] {
        font-size: 0.875rem !important;
    }

    .hero-description {
        font-size: var(--text-lg);
    }

    .cards-grid,
    .features-grid-custom {
        grid-template-columns: 1fr;
        /* 1 column on mobile */
    }

    .answer-options {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .progress-container {
        /* إعادة تنسيق شريط التقدم ليكون أفقيًا في وضع الهاتف كما كان */
        margin-bottom: var(--space-10);
        position: relative;
        top: auto;
    }

    .progress-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .progress-title {
        flex-basis: 100%;
        margin-bottom: var(--space-4);
        text-align: center;
    }

    .progress-stats {
        flex-direction: row;
        justify-content: space-between;
        gap: var(--space-4);
        border-top: none;
        margin-top: 0;
    }

    .question-navigation {
        flex-direction: column;
    }

    .nav-button {
        max-width: 100%;
    }

    .export-buttons {
        flex-direction: column;
    }

    .export-button {
        width: 100%;
    }

    .toast {
        bottom: var(--space-4);
        right: var(--space-4);
        left: var(--space-4);
        min-width: auto;
    }

    .pdf-score-section-enhanced {
        flex-direction: column;
    }

    .pdf-assessment-info-enhanced {
        grid-template-columns: 1fr;
    }

    /* **تعديل: تعديل الفواصل في الفوتر ليتناسب مع الهاتف** */
    .footer-link:not(:last-child)::after {
        content: '';
        /* إخفاء الفاصل الأسود في وضع الهاتف لمنع تكدس العناصر */
    }

    .footer-links {
        gap: var(--space-3);
    }
    
    /* لضمان ظهور الزرين بشكل جيد على الموبايل (Stack vertically) */
    .action-section-assessment {
        flex-direction: column;
        gap: var(--space-4);
        /* مسافة بين الزرين */
        justify-content: center;
        align-items: center;
    }
    
    /* جعل الأزرار تأخذ عرض الشاشة كاملاً على الموبايل */
    .action-section-assessment .cta-button {
        width: 100%;
        min-width: unset;
    }

    /* تحسين modal للجوال */
    .modal-overlay {
        padding: var(--space-4);
    }

    .modal-content {
        padding: var(--space-6);
        border-radius: var(--radius-2xl);
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-icon {
        font-size: 2.5rem;
        margin-bottom: var(--space-3);
    }

    .modal-title {
        font-size: var(--text-2xl);
    }

    .modal-body {
        margin-bottom: var(--space-6);
    }

    .modal-body li {
        font-size: var(--text-sm);
        padding: var(--space-2) 0;
        padding-right: var(--space-5);
    }

    .modal-button {
        padding: var(--space-4) var(--space-6);
        font-size: var(--text-base);
    }

    /* تحسين بطاقات التقييم للجوال */
    .card-header {
        padding: var(--space-6) var(--space-6) 0;
    }

    .card-body {
        padding: 0 var(--space-6) var(--space-6);
    }

    .card-icon-wrapper {
        width: 56px;
        height: 56px;
        font-size: 2rem;
    }

    .card-title {
        font-size: var(--text-xl);
    }

    /* تحسين قسم Hero للجوال */
    .hero {
        padding: calc(65px + var(--space-12)) 0 var(--space-12);
        min-height: auto;
    }

    .hero-container {
        padding: 0 var(--space-4);
    }

    .cta-button {
        padding: var(--space-4) var(--space-8);
        font-size: var(--text-lg);
        width: 100%;
    }

    /* تحسين الإحصائيات للجوال */
    .stat-item {
        padding: var(--space-4) var(--space-5);
        min-width: 120px;
    }

    .stat-number {
        font-size: var(--text-4xl);
    }

    /* تحسين قسم الميزات للجوال */
    .section-header {
        padding: 0 var(--space-2);
    }

    .section-title {
        font-size: var(--text-2xl);
    }

    .section-description {
        font-size: var(--text-base);
    }

    /* تحسين الفوتر للجوال */
    .footer {
        padding: var(--space-8) 0 var(--space-4);
        margin-top: var(--space-12);
    }

    .footer-text {
        font-size: var(--text-sm);
        padding: 0 var(--space-4);
    }

    .footer-disclaimer {
        margin: 0 var(--space-4) var(--space-4);
        font-size: var(--text-xs);
    }

    .footer-links {
        flex-direction: column;
        gap: var(--space-2);
    }

    .footer-link {
        font-size: var(--text-sm);
    }
}

/* ============================================
   Extra Small Screens (< 480px)
   ============================================ */
@media (max-width: 480px) {
    .header-content {
        height: 60px;
    }

    .logo-group {
        gap: var(--space-2);
    }

    .logo-mark {
        width: 36px;
        height: 36px;
    }

    .logo-text {
        font-size: var(--text-base);
    }

    /* إخفاء نص زر إخلاء المسؤولية وإظهار الأيقونة فقط */
    .header-disclaimer-btn {
        padding: 0.5rem;
        min-width: auto;
    }

    .header-disclaimer-btn span:not([style*="font-size"]) {
        display: none;
    }

    .hero-text h1 {
        font-size: var(--text-3xl);
    }

    .hero-description {
        font-size: var(--text-base);
    }

    .hero-stats {
        gap: var(--space-3);
    }

    .stat-item {
        padding: var(--space-3) var(--space-4);
        min-width: 100px;
    }

    .stat-number {
        font-size: var(--text-3xl);
    }

    .stat-label {
        font-size: var(--text-sm);
    }

    .card-title {
        font-size: var(--text-lg);
    }

    .card-description {
        font-size: var(--text-sm);
    }

    .modal-content {
        padding: var(--space-4);
    }

    .modal-title {
        font-size: var(--text-xl);
    }

    .modal-body li {
        font-size: var(--text-xs);
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    body {
        background: white;
        /* هذا يضمن أن الخلفية البيضاء هي خلفية الصفحة الفعلية للطباعة */
    }

    /* إخفاء واجهة الويب الأساسية أثناء الطباعة */
    .header,
    .footer,
    .export-section,
    .action-section,
    .modal-overlay,
    .loading-overlay,
    .toast,
    /* قم بإخفاء كل شيء تقريباً ماعدا القالب */
    #hero-section,
    #assessment-selection,
    #assessment-interface,
    #results-dashboard > .container > :not(.pdf-template-container) {
        display: none !important;
    }
    
    /* عرض قالب PDF لغرض الطباعة فقط */
    .pdf-template-enhanced {
        display: block !important;
        position: relative !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        /* ليتناسب مع عرض صفحة الطباعة */
        box-shadow: none !important;
        page-break-after: always;
    }

    .results-dashboard {
        padding: 0;
    }

    /* ضمان عدم قص العناصر الرئيسية في PDF */
    .analysis-card,
    .recommendation-card,
    .pdf-section-enhanced,
    .pdf-category-card,
    .pdf-recommendation-card,
    .pdf-priority-matrix {
        page-break-inside: avoid !important;
    }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Keyboard Navigation */
*:focus-visible {
    outline: 3px solid var(--color-emerald-500);
    outline-offset: 2px;
}

/* ============================================
   End of Stylesheet
   ============================================ */