/* ============================================
   دورة ثقافة العمل التطوعي - ملف CSS الرئيسي
   ============================================ */

:root {
    --primary-color: #f59e0b;
    --primary-dark: #d97706;
    --secondary-color: #1e293b;
    --secondary-light: #334155;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --text-dark: #1f2937;
    --text-light: #9ca3af;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   إعادة تعيين عام
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-dark);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
}

/* ============================================
   الحاويات والتخطيط
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   الرؤوس والنصوص
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.4;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   الأزرار
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-light);
    color: white;
}

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

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-block {
    width: 100%;
    display: block;
}

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

/* ============================================
   النماذج والمدخلات
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============================================
   البطاقات والصناديق
   ============================================ */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.card-body {
    margin-bottom: 1.5rem;
}

.card-footer {
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

/* ============================================
   شريط التقدم
   ============================================ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* ============================================
   الخيارات المتعددة (الأسئلة)
   ============================================ */
.option-group {
    display: grid;
    gap: 12px;
    margin: 1.5rem 0;
}

.option {
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    gap: 12px;
}

.option:hover {
    border-color: var(--primary-color);
    background: rgba(245, 158, 11, 0.05);
}

.option input[type="radio"] {
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.option.selected {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: var(--success-color);
}

.option.correct {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: var(--success-color);
}

.option.incorrect {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: var(--danger-color);
}

/* ============================================
   الفيديو
   ============================================ */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    margin-bottom: 2rem;
}

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

/* ============================================
   الصفحات والأقسام
   ============================================ */
.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.page-intro {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
}

.page-quiz {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
}

.page-success {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
}

/* ============================================
   الهيدر والفوتر
   ============================================ */
header {
    background: white;
    box-shadow: var(--shadow-md);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0;
}

footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* ============================================
   الشهادة
   ============================================ */
.certificate {
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    margin: 2rem auto;
    box-shadow: var(--shadow-lg);
}

.certificate-header {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.certificate-body {
    margin: 2rem 0;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.certificate-code {
    background: var(--bg-light);
    padding: 12px;
    border-radius: 8px;
    font-family: monospace;
    font-weight: 600;
    margin: 1rem 0;
    color: var(--primary-color);
}

/* ============================================
   الرسائل والتنبيهات
   ============================================ */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info-color);
    color: var(--info-color);
}

/* ============================================
   الشبكات والتخطيطات
   ============================================ */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.flex {
    display: flex;
    gap: 20px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* ============================================
   الاستجابة
   ============================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 15px;
    }

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

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

    .flex {
        flex-direction: column;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .card {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .page {
        padding: 10px 0;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    select,
    textarea {
        padding: 10px;
        font-size: 16px;
    }
}

/* ============================================
   الرموز والعناصر الخاصة
   ============================================ */
.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin: 0 8px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    margin: 0 auto 1rem;
}

/* ============================================
   الحركات والانتقالات
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}

/* ============================================
   الحالات الخاصة
   ============================================ */
.text-center {
    text-align: center;
}

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

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
