/* =============================================
   🎯 3D PREMIUM CONTAINERS — Substitution Hub
   مشابه لتصميم صفحة إعداد الجدول
   ============================================= */

/* ══════════════════════════════════════════
   البطاقة اليسرى: تسجيل الغياب (Glassmorphism 3D)
   ══════════════════════════════════════════ */
.sub-controls-card {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.94) 0%,
        rgba(255, 255, 255, 0.88) 100%) !important;
    border-radius: 28px !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.08),
        0 15px 35px rgba(99, 102, 241, 0.05),
        inset 0 1px 1px rgba(255, 255, 255, 1) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    position: sticky !important;
    top: 0px !important;
    overflow: hidden !important;
    animation: sub3d-slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* إضاءة داخلية علوية فخمة */
.sub-controls-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 100%;
    background: linear-gradient(to bottom, rgba(99, 102, 241, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 1;
}

/* خط علوي مضيء أزرق تقني */
.sub-controls-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
    border-radius: 24px 24px 0 0;
    pointer-events: none;
    z-index: 10;
}

/* توهج خلفي */
.sub-controls-card::after {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.sub-controls-card:hover {
    transform: translateY(-7px) !important;
    box-shadow:
        0 32px 65px rgba(0, 0, 0, 0.1),
        0 0 65px rgba(99, 102, 241, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 0 80px rgba(255, 255, 255, 0.5) !important;
    border-color: rgba(99, 102, 241, 0.45) !important;
}

/* أيقونة العنوان داخل البطاقة - أزرق فاتح */
.sub-controls-card h4.section-label i {
    background: linear-gradient(135deg, #3b82f6, #60a5fa) !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3) !important;
    border-radius: 10px !important;
    color: white !important;
}

/* ══════════════════════════════════════════
   الحاوية اليمنى: نتائج الاحتياط (Glassmorphism 3D)
   ══════════════════════════════════════════ */
.sub-results-card,
#sub-results-container {
    position: relative !important;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(255, 255, 255, 0.9) 100%) !important;
    border-radius: 28px !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.08),
        0 10px 20px rgba(16, 185, 129, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 0 20px rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    overflow: hidden !important;
}

/* خط علوي مضيء أزرق للحاوية المجاورة */
.sub-results-card::before,
#sub-results-container::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #93c5fd, #3b82f6);
    border-radius: 28px 28px 0 0;
    pointer-events: none;
    z-index: 10;
}

.sub-results-card:hover,
#sub-results-container:hover {
    transform: translateY(-6px) !important;
    box-shadow:
        0 40px 70px rgba(0, 0, 0, 0.12),
        0 15px 30px rgba(16, 185, 129, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 1) !important;
}

/* الحالة الفارغة شفافة لتظهر الخلفية الخضراء */
.sub-results-card .empty-state,
#sub-results-container .empty-state {
    background: transparent !important;
    border: none !important;
    border-radius: 20px !important;
}

/* ══════════════════════════════════════════
   شريط التحكم في لوحة المناوبة (أزرق ملكي)
   ══════════════════════════════════════════ */
.duty-header-controls {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(37, 99, 235, 0.07) 100%) !important;
    border-radius: 22px !important;
    border: 2px solid rgba(37, 99, 235, 0.18) !important;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.05),
        0 0 35px rgba(37, 99, 235, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding: 16px 22px !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    animation: sub3d-slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.duty-header-controls::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #93c5fd, #2563eb);
    border-radius: 22px 22px 0 0;
    pointer-events: none;
}

.duty-header-controls:hover {
    box-shadow:
        0 22px 48px rgba(0, 0, 0, 0.08),
        0 0 55px rgba(37, 99, 235, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 1) !important;
    border-color: rgba(37, 99, 235, 0.32) !important;
}

/* ══════════════════════════════════════════
   بطاقات المناوبة اليومية
   ══════════════════════════════════════════ */
.duty-card-modern {
    background: linear-gradient(145deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(248, 250, 252, 0.96) 100%) !important;
    border-radius: 20px !important;
    border: 1.5px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -3px 0 rgba(0, 0, 0, 0.05) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* شريط الألوان العلوي يظهر عند التحويم */
.duty-card-modern::after {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #8b5cf6, #06b6d4);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.duty-card-modern:hover {
    transform: translateY(-9px) scale(1.02) !important;
    box-shadow:
        0 28px 55px rgba(0, 0, 0, 0.11),
        0 10px 22px rgba(37, 99, 235, 0.13),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -5px 0 rgba(37, 99, 235, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
    z-index: 5;
}

.duty-card-modern:hover::after {
    opacity: 1;
}

/* ══════════════════════════════════════════
   بطاقات المرشحين للاحتياط
   ══════════════════════════════════════════ */
.sub-candidate-card-modern {
    background: linear-gradient(145deg,
        rgba(255, 255, 255, 0.99) 0%,
        rgba(239, 246, 255, 0.75) 100%) !important;
    border-radius: 18px !important;
    border: 1.5px solid rgba(191, 219, 254, 0.65) !important;
    box-shadow:
        0 6px 22px rgba(0, 0, 0, 0.04),
        0 2px 6px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -2px 0 rgba(37, 99, 235, 0.06) !important;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.sub-candidate-card-modern:hover {
    transform: translateY(-6px) translateX(-3px) !important;
    box-shadow:
        0 20px 42px rgba(37, 99, 235, 0.13),
        0 7px 16px rgba(0, 0, 0, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 1) !important;
    border-color: rgba(59, 130, 246, 0.52) !important;
    background: linear-gradient(145deg,
        rgba(255, 255, 255, 1) 0%,
        rgba(219, 234, 254, 0.65) 100%) !important;
}

/* ══════════════════════════════════════════
   سجل الغيابات اليومية
   ══════════════════════════════════════════ */
.sub-log-item {
    background: linear-gradient(145deg,
        rgba(255, 255, 255, 0.97) 0%,
        rgba(248, 250, 252, 0.92) 100%) !important;
    border-radius: 14px !important;
    border: 1px solid rgba(226, 232, 240, 0.72) !important;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -2px 0 rgba(0, 0, 0, 0.04) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sub-log-item:hover {
    transform: translateY(-3px) !important;
    box-shadow:
        0 10px 24px rgba(37, 99, 235, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -2px 0 rgba(37, 99, 235, 0.07) !important;
    border-color: rgba(147, 197, 253, 0.72) !important;
}

/* ══════════════════════════════════════════
   زر التحليل الذكي - نبض متوهج
   ══════════════════════════════════════════ */
@keyframes sub-btn-pulse {
    0%, 100% {
        box-shadow:
            0 6px 20px rgba(99, 102, 241, 0.4),
            0 0 0 0 rgba(99, 102, 241, 0.25);
    }
    50% {
        box-shadow:
            0 10px 30px rgba(99, 102, 241, 0.6),
            0 0 0 6px rgba(99, 102, 241, 0);
    }
}

.sub-controls-card .royal-action-btn {
    animation: sub-btn-pulse 2.8s infinite !important;
}

/* ══════════════════════════════════════════
   شريط العجز اللحظي (Slim & Gradient Header)
   ══════════════════════════════════════════ */
.sub-hub-header {
    background: linear-gradient(135deg, #020617 0%, #172554 45%, #1e3a8a 75%, #0ea5e9 100%) !important;
    height: auto !important;
    min-height: 100px !important; /* Slimmer by ~30% */
    border-radius: 28px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 
        0 25px 60px -15px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(14, 165, 233, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    overflow: hidden !important;
}

/* تقليل الحشو لتعزيز المظهر النحيف */
.sub-completion-stats, 
.deficit-bar-center, 
.sub-steps-badges {
    padding-top: 16px !important;
    padding-bottom: 16px !important;
}

/* عداد الاحتياط الكروي (Spherical 3D) */
.circular-progress-sub {
    width: 82px !important;
    height: 82px !important;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 60%) !important;
    border-radius: 50% !important;
    box-shadow: 
        inset -6px -6px 12px rgba(0, 0, 0, 0.45),
        inset 6px 6px 12px rgba(255, 255, 255, 0.05),
        0 10px 25px rgba(0, 0, 0, 0.25) !important;
}

.circular-progress-sub .progress-bg {
    stroke: rgba(255, 255, 255, 0.08) !important;
}

/* أزرار الخطوات الجانبية (Embossed & Slim) */
.sub-step-badge {
    padding: 7px 14px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    box-shadow: 
        3px 3px 6px rgba(0, 0, 0, 0.35),
        -1px -1px 2px rgba(255, 255, 255, 0.05),
        inset 1px 1px 0 rgba(255, 255, 255, 0.02) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sub-step-badge.active {
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 
        inset 3px 3px 8px rgba(0, 0, 0, 0.4),
        inset -1px -1px 2px rgba(255, 255, 255, 0.05),
        0 0 20px rgba(14, 165, 233, 0.2) !important;
    color: #fff !important;
}

.sub-step-icon {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.75rem !important;
    border-radius: 7px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 
        2px 2px 4px rgba(0,0,0,0.3),
        inset 1px 1px 0 rgba(255,255,255,0.1) !important;
}

.sub-step-badge.active .sub-step-icon {
    background: #0ea5e9 !important;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.6) !important;
    color: #0f172a !important;
}

/* كبسولات العجز المحسنة (3D Capsules) */
.deficit-capsule {
    box-shadow: 
        inset 0 1px 1px rgba(255,255,255,0.1),
        0 4px 10px rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    backdrop-filter: blur(8px) !important;
}

.deficit-bar-title {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* انيميشن الظهور للحاويات */
@keyframes sub3d-slideIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
