/* ==========================================================================
   MadaPower - Promotional Video Section CSS
   أنماط قسم الفيديو التعريفي
   ========================================================================== */

/* ===== Video Section ===== */
.video-section {
    padding: 80px 0;
    background: var(--gradient-dark);
    position: relative;
    overflow: hidden;
}

.video-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(30, 58, 138, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(14, 165, 233, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.video-section .section-header {
    position: relative;
    z-index: 1;
}

.video-section .section-title {
    color: white;
}

.video-section .section-desc {
    color: rgba(255, 255, 255, 0.8);
}

.video-section .section-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-energy-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Video Wrapper */
.video-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Video Container - 16:9 aspect ratio */
.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Video element - fill container */
.promo-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #0f172a;
}

/* Video Loading Indicator */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 2;
    transition: opacity var(--transition);
}

.video-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-energy-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Video Overlay (LIVE indicator) */
.video-overlay {
    position: absolute;
    top: 16px;
    inset-inline-start: 16px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    animation: pulse-live 2s infinite;
    z-index: 2;
}

.video-overlay-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-live-icon {
    font-size: 16px !important;
    color: white;
}

.video-live-text {
    letter-spacing: 1px;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.95); }
}

/* Video Controls Bar */
.video-controls {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 32px 16px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 3;
}

.video-container:hover .video-controls,
.video-container:focus-within .video-controls {
    opacity: 1;
}

/* Always show controls on mobile (no hover) */
@media (hover: none) {
    .video-controls {
        opacity: 1;
    }
}

/* Control Buttons */
.video-control-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.video-control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.video-control-btn:active {
    transform: scale(0.95);
}

.video-control-btn .material-symbols-rounded {
    font-size: 20px;
}

/* Video Progress Bar */
.video-progress {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.video-progress-bar {
    height: 100%;
    background: var(--gradient-energy);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: var(--radius-full);
}

/* Video Time Display */
.video-time {
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
    font-family: var(--font-mono);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Video Stats Below */
.video-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding: 0 8px;
}

.video-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition);
}

.video-stat:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.video-stat .material-symbols-rounded {
    font-size: 32px;
    color: var(--color-energy-light);
    background: rgba(245, 158, 11, 0.15);
    padding: 8px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.video-stat div {
    display: flex;
    flex-direction: column;
}

.video-stat strong {
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
}

.video-stat span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .video-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .video-section {
        padding: 40px 0;
    }

    .video-container {
        border-radius: var(--radius-md);
    }

    .video-overlay {
        top: 8px;
        inset-inline-start: 8px;
        padding: 4px 10px;
        font-size: 0.7rem;
    }

    .video-controls {
        padding: 24px 8px 8px;
        gap: 8px;
        opacity: 1; /* Always visible on mobile */
    }

    .video-control-btn {
        width: 32px;
        height: 32px;
    }

    .video-control-btn .material-symbols-rounded {
        font-size: 18px;
    }

    .video-time {
        font-size: 0.7rem;
        min-width: 65px;
    }

    .video-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 16px;
    }

    .video-stat {
        padding: 12px;
        gap: 8px;
    }

    .video-stat .material-symbols-rounded {
        font-size: 24px;
        padding: 6px;
    }

    .video-stat strong {
        font-size: 0.95rem;
    }

    .video-stat span {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .video-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .video-stat {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 8px;
    }

    .video-stat .material-symbols-rounded {
        font-size: 20px;
        padding: 4px;
    }

    .video-stat strong {
        font-size: 0.85rem;
    }

    .video-stat span {
        font-size: 0.65rem;
    }

    /* Hide fullscreen button on small mobile */
    #videoFullscreenBtn {
        display: none;
    }
}

/* ===== Print Styles ===== */
@media print {
    .video-section {
        display: none;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .video-overlay {
        animation: none;
    }

    .video-stat:hover {
        transform: none;
    }
}
