
/* ==========================================================================
   منظومة تسيير العطل الأكاديمية (القرار الوزاري رقم 1165 - المواد 20 إلى 23)
   Academic Leave System Styles (Decree 1165)
   ========================================================================== */

/* 1. الشريط الإعلاني الترويجي البارز بالصفحة الرئيسية */
.academic-leave-campaign-bar {
    background: linear-gradient(135deg, #064e3b 0%, #0c7c59 45%, #002855 100%);
    color: #ffffff;
    padding: 2.25rem 0;
    position: relative;
    z-index: 5;
    box-shadow: 0 4px 20px rgba(6, 78, 59, 0.25);
    border-bottom: 3px solid #c1965a;
    border-top: 1px solid rgba(193, 150, 90, 0.35);
    overflow: hidden;
    margin: 1.5rem 0 2.5rem 0;
    clear: both;
}

/* حل تداخل شريط العطل الأكاديمية مع شريط الإحصائيات العائم في جميع الحالات */
.academic-leave-campaign-bar + .hero-floating-stats-wrap,
.academic-leave-campaign-bar ~ .hero-floating-stats-wrap {
    margin-top: 2.5rem !important;
}

.hero-floating-stats-wrap + .academic-leave-campaign-bar {
    margin-top: 1.5rem !important;
    margin-bottom: 2.5rem !important;
}

@media (max-width: 992px) {
    .academic-leave-campaign-bar {
        padding: 1.8rem 0;
        margin-top: 1rem;
        margin-bottom: 2rem;
    }
    .academic-leave-campaign-bar + .hero-floating-stats-wrap,
    .academic-leave-campaign-bar ~ .hero-floating-stats-wrap {
        margin-top: 1.5rem !important;
    }
    .hero-floating-stats-wrap + .academic-leave-campaign-bar {
        margin-top: 1rem !important;
        margin-bottom: 2rem !important;
    }
}


.academic-leave-campaign-bar::before {
    content: "";
    position: absolute;
    top: -50px;
    left: -50px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.academic-leave-campaign-bar .container {
    position: relative;
    z-index: 2;
}

.campaign-inner-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 1.75rem;
    align-items: center;
}

@media (max-width: 992px) {
    .campaign-inner-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

.campaign-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.badge-legal-decree {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(4px);
}

.badge-zero-paper-pill {
    background: #c1965a;
    color: #002855;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-active-pulse {
    background: rgba(16, 185, 129, 0.25);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.5);
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.campaign-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 0.55rem 0;
    color: #ffffff;
}

.campaign-desc {
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    margin: 0;
}

.campaign-action-col {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 1.1rem;
    backdrop-filter: blur(8px);
}

.campaign-countdown-card {
    margin-bottom: 0.85rem;
}

.countdown-label {
    display: block;
    font-size: 0.82rem;
    color: #fde68a;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.countdown-boxes-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
}

.cbox {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    padding: 0.45rem 0.25rem;
    text-align: center;
}

.cnum {
    display: block;
    font-size: 1.3rem;
    font-weight: 900;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    line-height: 1.1;
}

.clbl {
    display: block;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.campaign-btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.btn-campaign-primary {
    background: #c1965a;
    color: #002855;
    border: none;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(193, 150, 90, 0.35);
}

.btn-campaign-primary:hover {
    background: #d4a96a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(193, 150, 90, 0.5);
}

.btn-campaign-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-campaign-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
}

.btn-campaign-outline {
    background: transparent;
    color: #fde68a;
    border: 1px dashed rgba(253, 230, 138, 0.5);
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-campaign-outline:hover {
    background: rgba(253, 230, 138, 0.15);
    border-style: solid;
}

/* 2. نوافذ منظومة العطل الأكاديمية (Modals & Forms) */
.cng-tab-btn {
    padding: 0.65rem 1rem;
    background: var(--bg-surface-alt, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-main, #334155);
    transition: all 0.2s ease;
}

.cng-tab-btn.active {
    background: #0c7c59;
    color: #ffffff;
    border-color: #0c7c59;
    box-shadow: 0 3px 8px rgba(12, 124, 89, 0.25);
}

.cng-alert-box {
    background: #f0fdf4;
    border-right: 4px solid #0c7c59;
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #166534;
}

.cng-alert-box.warning {
    background: #fffbeb;
    border-right-color: #b45309;
    color: #92400e;
}

.cng-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

@media (max-width: 650px) {
    .cng-form-grid {
        grid-template-columns: 1fr;
    }
}

.cng-pledge-card {
    background: #fafaf9;
    border: 1.5px solid #d6d3d1;
    border-radius: 8px;
    padding: 0.9rem;
    margin: 1rem 0;
}

.cng-pledge-card h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.88rem;
    color: #b91c1c;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cng-pledge-card ul {
    margin: 0 0 0.75rem 0;
    padding-right: 1.25rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #44403c;
}

.cng-pipeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 1.5rem 0 2rem 0;
}

.cng-pipeline::before {
    content: "";
    position: absolute;
    top: 18px;
    right: 25px;
    left: 25px;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
}

.cng-step {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.cng-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.4rem auto;
    font-weight: 800;
    font-size: 0.85rem;
    color: #64748b;
    transition: all 0.3s;
}

.cng-step.done .cng-step-circle {
    background: #0c7c59;
    border-color: #0c7c59;
    color: #ffffff;
}

.cng-step.active .cng-step-circle {
    background: #c1965a;
    border-color: #002855;
    color: #002855;
    box-shadow: 0 0 0 4px rgba(193, 150, 90, 0.25);
}

.cng-step-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    line-height: 1.25;
}

/* 3. وصل الإيداع الرسمي والطباعة */
.cng-receipt-sheet {
    background: #ffffff;
    color: #0f172a;
    border: 2px solid #002855;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    position: relative;
    font-family: 'Cairo', 'Almarai', sans-serif;
}

.cng-receipt-header {
    text-align: center;
    border-bottom: 2px solid #002855;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
}

.cng-receipt-header .rep-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: #002855;
}

.cng-receipt-header .univ-title {
    font-size: 0.8rem;
    color: #475569;
    margin-top: 0.2rem;
}

.cng-receipt-title-box {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0.75rem 0;
    text-align: center;
}

.cng-receipt-title-box h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #002855;
}

.cng-receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.85rem 0;
    font-size: 0.83rem;
}

.cng-receipt-table th, 
.cng-receipt-table td {
    padding: 0.45rem 0.65rem;
    border: 1px solid #cbd5e1;
}

.cng-receipt-table th {
    background: #f8fafc;
    width: 28%;
    font-weight: 700;
    color: #1e293b;
    text-align: right;
}

.cng-receipt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #cbd5e1;
}

/* 4. تصميم محضر الإيداع الجماعي الموحد لنيابة الجامعة */
.collective-pv-wrapper {
    background: #ffffff;
    color: #1e293b;
    padding: 1.8rem;
    border: 2px solid #002855;
    border-radius: 8px;
    font-size: 8.8pt;
    line-height: 1.45;
}

.collective-pv-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 8.2pt;
}

.collective-pv-table th,
.collective-pv-table td {
    border: 1px solid #002855;
    padding: 5px 6px;
    text-align: center;
}

.collective-pv-table th {
    background: #f1f5f9;
    color: #002855;
    font-weight: 800;
}

/* تنسيق الطباعة التلقائية لمحتوى المحضر أو الوصل */
@media print {
    body * {
        visibility: hidden;
    }
    .cng-printable-area, .cng-printable-area * {
        visibility: visible;
    }
    .cng-printable-area {
        position: absolute;
        right: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .no-print {
        display: none !important;
    }
}


/* ==========================================================================
   بطاقات رفع وتصوير وثائق العطلة الأكاديمية (شهادة التسجيل + الملف الثبوتي)
   ========================================================================== */
.cng-docs-mandatory-section {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 1.15rem;
    margin: 1.25rem 0;
}

.cng-docs-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #002855;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cng-docs-section-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.cng-upload-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.cng-upload-card.has-file {
    border-color: #10b981;
    background: #f0fdf4;
}

.cng-upload-card.has-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.cng-upload-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.cng-upload-card-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #002855;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.cng-req-badge {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.cng-req-badge.ready {
    background: #d1fae5;
    color: #059669;
    border-color: #6ee7b7;
}

.cng-upload-hint {
    font-size: 0.78rem;
    color: #64748b;
    margin: 0 0 0.85rem 0;
    line-height: 1.45;
}

.cng-dual-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 580px) {
    .cng-dual-action-row {
        grid-template-columns: 1fr;
    }
}

.btn-cng-action-upload,
.btn-cng-action-camera {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-cng-action-upload {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

.btn-cng-action-upload:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
}

.btn-cng-action-camera {
    background: #0c7c59;
    color: #ffffff;
}

.btn-cng-action-camera:hover {
    background: #064e3b;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(12, 124, 89, 0.3);
    transform: translateY(-1px);
}

.cng-doc-preview-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #ffffff;
    border: 1.5px solid #10b981;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    margin-top: 0.65rem;
    box-shadow: 0 2px 5px rgba(16, 185, 129, 0.1);
    animation: fadeInDoc 0.3s ease;
}

@keyframes fadeInDoc {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.cng-preview-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.cng-preview-thumb-wrap {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cng-preview-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cng-preview-thumb-wrap i {
    font-size: 1.5rem;
    color: #dc2626;
}

.cng-preview-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cng-preview-filename {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.cng-preview-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #059669;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cng-preview-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-doc-view,
.btn-doc-remove {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.btn-doc-view {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.btn-doc-view:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-doc-remove {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-doc-remove:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* ستايل نافذة الكاميرا الحية */
#academic-leave-camera-modal .modal-card {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.camera-guide-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #c1965a;
    border-style: solid;
    pointer-events: none;
}
.camera-guide-tl { top: 12px; left: 12px; border-width: 3px 0 0 3px; }
.camera-guide-tr { top: 12px; right: 12px; border-width: 3px 3px 0 0; }
.camera-guide-bl { bottom: 12px; left: 12px; border-width: 0 0 3px 3px; }
.camera-guide-br { bottom: 12px; right: 12px; border-width: 0 3px 3px 0; }
