﻿/* ===========================================================
    Jordan Elections Platform - GOVERNMENT OFFICIAL THEME
    رسمي | احترافي | وطني | مستوحى من ألوان العلم الأردني
=========================================================== */

/* -----------------------------------------------------------
    1. ROOT VARIABLES (Official Jordanian Colors)
----------------------------------------------------------- */
:root {
    /* Primary Colors - مستوحاة من العلم الأردني */
    --primary: #007A3D; /* أخضر - لون العلم */
    --primary-dark: #005A2C;
    --primary-light: #E8F5EE;
    --secondary: #CE1126; /* أحمر - لون العلم */
    --secondary-light: #FBEAEC;
    --accent: #000000; /* أسود - لون العلم */
    --accent-light: #F5F5F5;
    /* Neutral & Background - ألوان محايدة رسمية */
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --text-dark: #212529;
    --text-muted: #6C757D;
    --border-light: #DEE2E6;
    --border-dark: #ADB5BD;
    /* Status Colors - ألوان الحالة */
    --success: #007A3D;
    --success-light: #E8F5EE;
    --warning: #FFC107;
    --warning-light: #FFF9E6;
    --danger: #CE1126;
    --danger-light: #FBEAEC;
    --info: #0D6EFD;
    --info-light: #E7F1FF;
    /* UI Primitives */
    --rounded-sm: 4px;
    --rounded-md: 8px;
    --rounded-lg: 12px;
    --transition-speed: 0.3s;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* -----------------------------------------------------------
    2. GLOBAL LAYOUT & TYPOGRAPHY (Sticky Footer & RTL)
----------------------------------------------------------- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 100%;
    min-height: 100vh;
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    direction: rtl;
    text-align: right;
    line-height: 1.6;
    font-weight: 400;
}

/* الهيدر */
header {
    grid-row: 1;
}

/* المحتوى الرئيسي */
main {
    grid-row: 2;
    padding: 20px;
}

/* الفوتر */
.footer {
    grid-row: 3;
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
    color: white;
    border-top: 3px solid var(--secondary);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    position: relative !important;
    bottom: 0 !important;
    width: 100% !important;
}

/* -----------------------------------------------------------
    3. NAVIGATION BAR - شريط التنقل الرسمي
----------------------------------------------------------- */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    padding: 12px 20px;
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--secondary);
}

.navbar-brand {
    font-weight: 700;
    color: white !important;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-left: 15px;
    transition: all var(--transition-speed);
    padding: 8px 12px !important;
    border-radius: var(--rounded-sm);
    font-weight: 500;
    position: relative;
}

    .nav-link:hover {
        color: white !important;
        background-color: rgba(255, 255, 255, 0.15);
        text-decoration: none;
        transform: translateY(-1px);
    }

    .nav-link.active {
        background-color: var(--secondary);
        color: white !important;
        font-weight: 600;
    }

/* -----------------------------------------------------------
    4. FORMS & INPUTS - نماذج وإدخالات
----------------------------------------------------------- */
input[type="text"], input[type="date"], input[type="number"], input[type="email"], input[type="password"], select, textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--rounded-md);
    border: 1px solid var(--border-dark);
    background: var(--bg-white);
    margin-bottom: 15px;
    transition: all var(--transition-speed);
    font-size: 1rem;
    font-family: inherit;
}

    input:focus, select:focus, textarea:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(0, 122, 61, 0.2);
        background-color: var(--primary-light);
    }

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: block;
}

/* -----------------------------------------------------------
    5. BUTTONS - أزرار
----------------------------------------------------------- */
.btn-primary, .vote-btn, .btn-success, .btn-danger, .btn-warning, .btn-info {
    border: none;
    padding: 12px 24px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--rounded-md);
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.btn-primary, .vote-btn {
    background: var(--primary);
    border: 1px solid var(--primary-dark);
}

    .btn-primary:hover, .vote-btn:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.btn-success {
    background: var(--success);
    border: 1px solid var(--primary-dark);
}

    .btn-success:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.btn-danger {
    background: var(--danger);
    border: 1px solid #a00d1e;
}

    .btn-danger:hover {
        background: #a00d1e;
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.btn-warning {
    background: var(--warning);
    color: var(--text-dark);
    border: 1px solid #e0a800;
}

    .btn-warning:hover {
        background: #e0a800;
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.btn-info {
    background: var(--info);
    border: 1px solid #0b5ed7;
}

    .btn-info:hover {
        background: #0b5ed7;
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

/* -----------------------------------------------------------
    6. CARDS & BOXES - بطاقات وصناديق
----------------------------------------------------------- */
.card, .admin-box, .box, .verify-box, .success-box, .candidate-card, .stat-card, .gov-card {
    background: var(--bg-white);
    border-radius: var(--rounded-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

    .card::before, .candidate-card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 5px;
        height: 100%;
        background: var(--primary);
    }

    .card:hover, .candidate-card:hover, .gov-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
        border-color: var(--primary);
    }

.candidate-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: var(--rounded-md);
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
}

/* -----------------------------------------------------------
    7. TABLES - جداول
----------------------------------------------------------- */
.table {
    border-radius: var(--rounded-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

    .table thead {
        background: linear-gradient(to right, var(--primary), var(--primary-dark));
        color: white;
    }

    .table th {
        font-weight: 700;
        padding: 15px 12px;
        border-bottom: 2px solid var(--secondary);
    }

    .table td {
        padding: 12px;
        border-bottom: 1px solid var(--border-light);
    }

    .table tbody tr:nth-child(even) {
        background: var(--bg-light);
    }

    .table tbody tr:hover {
        background: var(--primary-light);
        cursor: pointer;
    }

.top-candidate {
    background: var(--success-light) !important;
    font-weight: 800;
    border-right: 5px solid var(--success) !important;
}

/* -----------------------------------------------------------
    8. SUMMARY CARDS - بطاقات ملخصة
----------------------------------------------------------- */
.summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-bottom: 5px solid var(--primary);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-speed);
    border-radius: var(--rounded-lg);
    box-shadow: var(--shadow-sm);
}

    .summary-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-md);
        border-bottom-color: var(--secondary);
    }

/* -----------------------------------------------------------
    9. HERO SECTION - قسم البطل
----------------------------------------------------------- */
.hero-section {
    position: relative;
    padding: 150px 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('/images/jordan-flag.jpg') center/cover no-repeat;
    min-height: 450px;
    text-align: center;
    color: white;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 122, 61, 0.8), rgba(206, 17, 38, 0.6));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    animation: fadeIn 1.2s ease-out forwards;
    opacity: 0;
    max-width: 800px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-start {
    background: var(--secondary);
    padding: 16px 35px;
    border-radius: var(--rounded-md);
    color: white;
    font-size: 22px;
    font-weight: bold;
    box-shadow: 0 8px 15px rgba(206, 17, 38, 0.4);
    transition: all var(--transition-speed) ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

    .btn-start:hover {
        background: #a00d1e;
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 12px 20px rgba(206, 17, 38, 0.5);
    }

/* -----------------------------------------------------------
    10. DASHBOARD & STATS - لوحة التحكم والإحصائيات
----------------------------------------------------------- */
.page-title {
    text-align: center;
    margin-bottom: 40px;
    font-weight: 900;
    color: var(--primary);
    position: relative;
    padding-bottom: 15px;
}

    .page-title::after {
        content: '';
        display: block;
        width: 100px;
        height: 4px;
        background: linear-gradient(to right, var(--primary), var(--secondary));
        margin: 10px auto 0;
        border-radius: 2px;
    }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.stat-card {
    border-right: 6px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-speed);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.stat-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 28px;
    box-shadow: var(--shadow-md);
    margin-bottom: 15px;
}

.stat-number {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary);
    margin: 10px 0;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1rem;
}

/* -----------------------------------------------------------
    11. GOVERNORATES GRID - شبكة المحافظات
----------------------------------------------------------- */
.governorates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gov-card {
    padding: 20px;
    border-left: 5px solid var(--border-light);
    transition: all var(--transition-speed);
}

    .gov-card:hover {
        border-left-color: var(--primary);
    }

.gov-name {
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .gov-name::before {
        content: "📍";
    }

.gov-counter {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.gov-voted, .gov-not-voted {
    flex: 1;
    padding: 10px;
    border-radius: var(--rounded-md);
    text-align: center;
}

.gov-voted {
    background: var(--success-light);
    border: 1px solid rgba(0, 122, 61, 0.2);
}

.gov-not-voted {
    background: var(--danger-light);
    border: 1px solid rgba(206, 17, 38, 0.2);
}

.gov-number {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 5px;
}

.gov-voted .gov-number {
    color: var(--success);
}

.gov-not-voted .gov-number {
    color: var(--danger);
}

.gov-label {
    display: block;
    font-size: 13px;
    color: #444;
    font-weight: 500;
}

/* -----------------------------------------------------------
    12. CANDIDATES CONTAINER - حاوية المرشحين
----------------------------------------------------------- */
.candidates-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    padding: 20px;
}

.card {
    border: 1px solid var(--border-light);
    border-radius: var(--rounded-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

    .card::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 5px;
        height: 100%;
        background: var(--primary);
    }

    .card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-md);
        border-color: var(--primary);
    }

    .card h3 {
        margin: 10px 0 5px;
        font-size: 1.2rem;
        color: var(--primary);
        font-weight: 700;
    }

    .card p {
        margin: 0 0 15px;
        color: var(--text-muted);
        font-size: 0.9rem;
    }

.vote-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--rounded-md);
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.2s;
    width: 100%;
}

    .vote-btn:hover {
        background-color: var(--primary-dark);
        transform: translateY(-2px);
    }

/* -----------------------------------------------------------
    13. BADGES & LABELS - شارات وتسميات
----------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: #856404;
}

/* -----------------------------------------------------------
    14. RESPONSIVE ADJUSTMENTS - تعديلات الاستجابة
----------------------------------------------------------- */
@media (max-width: 992px) {
    .page-title {
        margin-bottom: 30px;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    main {
        padding: 15px;
    }

    .hero-section {
        min-height: 350px;
        padding: 100px 15px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .btn-start {
        font-size: 18px;
        padding: 12px 25px;
    }

    .stat-number {
        font-size: 26px;
    }

    .summary-container, .stats-grid, .governorates-grid, .candidates-container {
        grid-template-columns: 1fr;
    }

    .gov-counter {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.3rem;
    }

    .stat-card {
        padding: 14px;
    }

    .candidate-card {
        padding: 18px;
    }

    .table thead {
        display: none;
    }

    .table td {
        display: block;
        text-align: right;
        padding: 10px 15px;
    }

        .table td::before {
            content: attr(data-label);
            font-weight: bold;
            display: block;
            margin-bottom: 5px;
            color: var(--primary);
        }

    .card img {
        height: 300px;
    }
}

/* -----------------------------------------------------------
    15. UTILITY CLASSES - فئات مساعدة
----------------------------------------------------------- */
.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--secondary) !important;
}

.bg-primary-light {
    background-color: var(--primary-light) !important;
}

.bg-secondary-light {
    background-color: var(--secondary-light) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

.border-secondary {
    border-color: var(--secondary) !important;
}

.shadow-custom {
    box-shadow: var(--shadow-lg) !important;
}

.gradient-bg {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
}

.hero-logo-circle {
    width: 300px;
    height: 300px;
    border-radius: 100%;
    background: white;
    padding: 1px;
    margin: 0 auto 1px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.hero-logo-circle img {
    max-width: 100%;
    height: auto;
    border-radius: 100%;
}