/* ================= المتغيرات الأساسية (Variables) ================= */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #27ae60;
    --bg-light: #f8f9fa;
    --text-dark: #333333;
    --text-light: #ffffff;
    --border-color: #e2e8f0;
}

/* ================= التنسيقات العامة ================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: #ffffff;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
    padding: 0 20px;
}

.section-padding { padding: 60px 0; }
.section-title { font-size: 32px; color: var(--primary-color); margin-bottom: 10px; text-align: center; }
.section-subtitle { text-align: center; color: #666; margin-bottom: 40px; max-width: 800px; margin-left: auto; margin-right: auto; }

/* ================= تحسين الخطوط العربية (RTL) ================= */
html[dir="rtl"] body { font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4, html[dir="rtl"] .logo { font-family: 'Cairo', sans-serif; font-weight: 700; letter-spacing: -0.5px; }

/* ================= الهيدر والقائمة (Header & Nav) ================= */
header { background: var(--text-light); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1000; }
.nav-wrapper { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; }
.logo { font-size: 24px; font-weight: bold; color: var(--primary-color); text-decoration: none; }
.logo span { color: var(--secondary-color); }
.nav-links { list-style: none; display: flex; margin: 0; padding: 0; }
.nav-links li { padding: 0 15px; }
.nav-links a { text-decoration: none; color: var(--primary-color); font-weight: 600; transition: color 0.3s; font-size: 0.95em; }
.nav-links a:hover { color: var(--secondary-color); }

/* ================= مكونات ElectroVoting الموحدة (DRY Components) ================= */

/* 1. الشبكة الموحدة المتجاوبة (Unified Grid) */
.electro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* 2. الصندوق الموحد (Unified Card) */
.electro-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: 4px solid var(--secondary-color); 
    border-radius: 8px;
    padding: 30px 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    height: auto; /* <--- السحر هنا: هذا يمنع فيضان النص وتداخله مع الزر */
    text-align: start; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.electro-card:hover {
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* 3. عنوان الصندوق الموحد */
.electro-card .card-title {
    color: var(--primary-color);
    font-size: 1.25em;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #e2e8f0;
    min-height: 65px; 
    display: flex;
    align-items: center;
    line-height: 1.4;
}

/* 4. نصوص وقوائم الصندوق الموحد */
.electro-card .card-body {
    flex-grow: 1; 
    color: #475569;
    line-height: 1.7;
    font-size: 0.95em;
    margin: 0;
}

.electro-card ul.card-list {
    list-style-type: disc;
    padding-inline-start: 20px;
    margin: 0;
}

.electro-card ul.card-list li {
    margin-bottom: 12px;
}

.sub-title {
    color: #27ae60;
    margin-top: 0;
    font-size: 1.8em;
}

/* ================= ترويسة الصفحات الداخلية (Inner Pages Banner) ================= */
.page-banner {
    background-color: var(--primary-color);
    /* نقشة هندسية شفافة وأنيقة مبرمجة بالـ CSS لمحاكاة الصورة المرفقة */
    background-image: 
        linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.03) 75%, rgba(255,255,255,0.03)), 
        linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.03) 75%, rgba(255,255,255,0.03));
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
    padding: 70px 20px;
    text-align: center;
    border-bottom: 4px solid var(--secondary-color);
    position: relative;
    margin-bottom: 40px;
}

.page-banner h1 {
    color: #ffffff;
    margin: 0;
    font-size: 2.5em;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .page-banner { padding: 50px 20px; margin-bottom: 30px; }
    .page-banner h1 { font-size: 1.8em; }
}

/* ================= نموذج الطلب (Application Form) ================= */
.app-form-container { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); border-top: 5px solid var(--primary-color); margin-top: 30px; }
.form-row { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; }
.form-group { flex: 1; min-width: 250px; display: flex; flex-direction: column; }
.form-group label { font-weight: 600; margin-bottom: 8px; color: var(--primary-color); font-size: 0.95em; }
.form-control { padding: 12px; border: 1px solid #ccc; border-radius: 4px; font-family: inherit; font-size: 1em; background-color: #fcfcfc; transition: all 0.3s; }
.form-control:focus { outline: none; border-color: var(--secondary-color); box-shadow: 0 0 5px rgba(39, 174, 96, 0.2); background-color: #fff; }
.radio-group { margin-bottom: 25px; padding: 15px 20px; background: var(--bg-light); border-radius: 6px; border: 1px solid var(--border-color); }
.radio-group label.question { display: block; font-weight: 600; color: var(--primary-color); margin-bottom: 12px; }
.radio-option { display: flex; align-items: center; margin-bottom: 8px; cursor: pointer; }
.radio-option input { margin: 0 10px 0 0; }
html[dir="rtl"] .radio-option input { margin: 0 0 0 10px; }
.form-section-title { color: var(--secondary-color); margin-top: 40px; margin-bottom: 5px; border-bottom: 2px solid var(--bg-light); padding-bottom: 10px; }
.btn-submit { background: #2980b9; color: white; padding: 15px 40px; border: none; border-radius: 4px; font-size: 1.1em; font-weight: bold; cursor: pointer; transition: background 0.3s; margin-top: 20px; width: 100%; max-width: 300px; }
.btn-submit:hover { background: #2471a3; }
.time-inputs { display: flex; gap: 10px; }
.time-inputs .form-control { width: 33.33%; }

/* ================= الفوتر ================= */
footer { background: var(--primary-color); color: var(--text-light); text-align: center; padding: 20px 0; margin-top: 40px; }

/* ================= Responsive (الجوال) ================= */
@media (max-width: 768px) {
    .nav-wrapper { flex-wrap: wrap; }
    .nav-links { margin-top: 15px; flex-wrap: wrap; justify-content: center; width: 100%; }
    .lang-dropdown { position: absolute; right: 20px; top: 15px; }
    html[dir="rtl"] .lang-dropdown { left: 20px; right: auto; }
    .app-form-container { padding: 20px; }
}