/* ===== MEDIA COMPONENTS ===== */

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.85);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-container:hover .video-thumbnail {
    filter: brightness(1);
    transform: scale(1.05);
}

/* Play Button Enhancement */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--error), #dc2626);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    box-shadow:
        0 10px 30px rgba(239, 68, 68, 0.4),
        0 0 0 8px rgba(239, 68, 68, 0.2);
}

.video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow:
        0 15px 40px rgba(239, 68, 68, 0.6),
        0 0 0 12px rgba(239, 68, 68, 0.3);
}

.video-play-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Play Button Pulse Animation */
@keyframes playButtonPulse {
    0% {
        box-shadow:
            0 10px 30px rgba(239, 68, 68, 0.4),
            0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow:
            0 10px 30px rgba(239, 68, 68, 0.4),
            0 0 0 20px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow:
            0 10px 30px rgba(239, 68, 68, 0.4),
            0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.video-play-btn.pulse {
    animation: playButtonPulse 2s infinite;
}

/* Video Overlay */
.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    z-index: 5;
}

.video-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.video-duration-badge {
    padding: 0.4rem 0.8rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 10;
}

.video-views {
    color: white;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

/* Video Placeholder */
.video-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark), var(--dark-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 3rem;
}

/* Carousel Container */
.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.carousel-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 60%,
        rgba(0, 0, 0, 0.3) 90%
    );
    pointer-events: none;
    z-index: 5;
    border-radius: var(--radius-lg);
}

/* Carousel Track */
.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    min-width: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Navigation Buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.carousel-container:hover .carousel-nav {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.carousel-nav:hover {
    background: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 25px rgba(124, 58, 237, 0.4);
}

.carousel-prev {
    right: 16px;
    left: auto;
}

.carousel-next {
    left: 16px;
    right: auto;
}

/* Counter Display */
.carousel-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.current-slide {
    color: var(--primary-light);
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.counter-separator {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 2px;
}

.total-slides {
    color: rgba(255, 255, 255, 0.8);
    min-width: 20px;
    text-align: center;
}

/* Dots Navigation */
.carousel-dots {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 15;
    padding: 0 10px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--primary-light);
    width: 24px;
    border-radius: 6px;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

/* Touch-friendly area for dots */
.carousel-dot::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
}

/* Hide navigation on single slide */
.carousel-container.single-slide .carousel-nav,
.carousel-container.single-slide .carousel-dots,
.carousel-container.single-slide .carousel-counter {
    display: none !important;
}

/* Animation for slide change */
@keyframes slideIn {
    from {
        opacity: 0.8;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.carousel-slide.active {
    animation: slideIn 0.4s ease-out;
}

/* Pulse animation for new slide */
@keyframes pulseSlide {
    0% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(124, 58, 237, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
    }
}

.carousel-slide.active img {
    animation: pulseSlide 0.5s ease-out;
}

/* Carousel loading state */
.carousel-container.loading .carousel-slide img {
    filter: blur(5px);
}

.carousel-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carousel-nav {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        opacity: 0.7;
    }

    .carousel-prev {
        right: 8px;
    }

    .carousel-next {
        left: 8px;
    }

    .carousel-counter {
        padding: 4px 12px;
        font-size: 0.8rem;
        bottom: 12px;
    }

    .carousel-dots {
        bottom: 50px;
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
    }

    .carousel-dot.active {
        width: 20px;
    }

    .video-play-btn {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .carousel-nav {
        width: 32px;
        height: 32px;
        opacity: 1;
    }

    .carousel-container:hover .carousel-nav {
        opacity: 1;
    }

    .video-play-btn {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .carousel-nav {
        background: rgba(0, 0, 0, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .carousel-counter {
        background: rgba(0, 0, 0, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Accessibility improvements */
.carousel-nav:focus,
.carousel-dot:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.video-play-btn:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
}

/* Loading state for video */
.video-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    z-index: 15;
}

.video-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 20;
}

/* Print styles */
@media print {
    .carousel-nav,
    .carousel-dots,
    .carousel-counter {
        display: none !important;
    }

    .carousel-track {
        transform: none !important;
    }

    .carousel-slide {
        display: block !important;
        page-break-inside: avoid;
    }

    .carousel-slide:not(:first-child) {
        display: none !important;
    }

    .video-play-btn {
        display: none !important;
    }
}
/* ===== INLINE VIDEO PLAYER STYLES ===== */

.video-container {
    position: relative;
    overflow: hidden;
}

.video-container.playing {
    z-index: 10; /* Bring playing video to front */
}

.video-container .youtube-player iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Hide YouTube's default controls */
.video-container .youtube-player div {
    pointer-events: none;
}

.video-container .youtube-player iframe {
    pointer-events: auto;
}

/* Smooth transitions */
.video-thumbnail,
.video-play-btn,
.youtube-player {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* When player is active */
.video-container.player-active .video-thumbnail,
.video-container.player-active .video-play-btn {
    opacity: 0;
    pointer-events: none;
}

.video-container.player-active .youtube-player {
    opacity: 1;
}

/* Fullscreen styles */
.video-container:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #000;
}

.video-container:fullscreen .youtube-player {
    width: 100%;
    height: 100%;
}

.video-container:fullscreen .video-custom-controls {
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
}

/* Responsive video player */
@media (max-width: 768px) {
    .video-container .video-custom-controls {
        padding: 8px;
    }

    .video-container .control-btn {
        font-size: 16px;
    }

    .video-container .time-display {
        font-size: 10px;
    }
}

/* Accessibility */
.video-container:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.video-container .control-btn:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}
/* ===== MEDIA COMPONENTS - ENHANCED SIZING ===== */

/* Video Container - Larger Size */
.video-container {
    position: relative;
    width: 100%;
    height: 280px; /* Increased from 250px */
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .video-container {
        height: 320px; /* Even larger on tablets */
    }
}

@media (min-width: 1024px) {
    .video-container {
        height: 360px; /* Largest on desktop */
    }
}

/* Video Thumbnail - Optimized */
.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
    filter: brightness(0.9);
}

.video-container:hover .video-thumbnail {
    filter: brightness(1);
    transform: scale(1.02);
}

/* Play Button - Better Positioning */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--error), #dc2626);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow:
        0 10px 30px rgba(239, 68, 68, 0.4),
        0 0 0 8px rgba(239, 68, 68, 0.2);
    opacity: 1;
}

.video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.15);
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow:
        0 15px 40px rgba(239, 68, 68, 0.6),
        0 0 0 12px rgba(239, 68, 68, 0.3);
}

.video-play-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.video-play-btn.pulse {
    animation: playButtonPulse 2s infinite;
}

@keyframes playButtonPulse {
    0%, 100% {
        box-shadow:
            0 10px 30px rgba(239, 68, 68, 0.4),
            0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow:
            0 10px 30px rgba(239, 68, 68, 0.4),
            0 0 0 20px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow:
            0 10px 30px rgba(239, 68, 68, 0.4),
            0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Loading Spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 25;
    backdrop-filter: blur(5px);
}

.video-loading.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    position: absolute;
    bottom: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

/* Video Info Overlay */
.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: white;
    z-index: 5;
    pointer-events: none;
}

.video-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.video-duration-badge {
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-views {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

/* Player Wrapper */
.player-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20;
}

/* When player is active */
.video-container.player-active .video-thumbnail,
.video-container.player-active .video-play-btn,
.video-container.player-active .video-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
}

.video-container.player-active .player-wrapper {
    opacity: 1 !important;
}

/* YouTube Player Customization */
.player-wrapper iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
}

/* Hide YouTube's default controls when not hovered */
.player-wrapper:not(:hover) .ytp-chrome-top,
.player-wrapper:not(:hover) .ytp-progress-bar-container {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Fullscreen Mode */
.video-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000 !important;
    border-radius: 0 !important;
}

.video-container:fullscreen .player-wrapper {
    width: 100% !important;
    height: 100% !important;
}

/* Carousel Container - Larger Size */
.carousel-container {
    position: relative;
    width: 100%;
    height: 280px; /* Match video height */
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000;
}

@media (min-width: 768px) {
    .carousel-container {
        height: 320px;
    }
}

@media (min-width: 1024px) {
    .carousel-container {
        height: 360px;
    }
}

/* Image Container - Larger Size */
.image-container {
    width: 100%;
    height: 280px; /* Match video height */
    overflow: hidden;
    border-radius: var(--radius-lg);
}

@media (min-width: 768px) {
    .image-container {
        height: 320px;
    }
}

@media (min-width: 1024px) {
    .image-container {
        height: 360px;
    }
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-image:hover {
    transform: scale(1.05);
}

/* Carousel Navigation - Optimized */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s ease;
    opacity: 0;
}

.carousel-container:hover .carousel-nav {
    opacity: 1;
}

.carousel-prev {
    right: 16px;
    left: auto;
}

.carousel-next {
    left: 16px;
    right: auto;
}

/* Carousel Counter */
.carousel-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 15;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Carousel Dots */
.carousel-dots {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 15;
    padding: 0 10px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot.active {
    background: var(--primary-light);
    width: 24px;
    border-radius: 6px;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

/* Smooth Transitions */
.video-thumbnail,
.video-play-btn,
.player-wrapper,
.video-overlay {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accessibility */
.video-container:focus-within {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.video-play-btn:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
}

/* Post Card Adjustments for Larger Media */
.post-card {
    height: 600px; /* Slightly taller to accommodate larger media */
}

.post-media-section {
    height: 320px; /* Increased media section height */
}

@media (max-width: 768px) {
    .post-card {
        height: 580px;
    }

    .post-media-section {
        height: 280px;
    }
}

/* Video Placeholder */
.video-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark), var(--dark-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 3rem;
}

/* Error State */
.video-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    z-index: 30;
    padding: 20px;
    text-align: center;
}

.video-error-icon {
    font-size: 40px;
    color: #ff6b6b;
    margin-bottom: 15px;
}

.video-error-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.video-error-message {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 20px;
}

/* Performance Optimizations */
.video-container,
.carousel-container,
.image-container {
    will-change: transform;
    contain: layout style paint;
}

/* Print Styles */
@media print {
    .video-container,
    .carousel-container,
    .image-container {
        break-inside: avoid;
    }

    .video-play-btn,
    .carousel-nav,
    .carousel-dots {
        display: none !important;
    }
}
/* Add to media_components.css */

/* Ensure play button is always clickable */
.video-play-btn {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 10 !important;
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth transitions for player */
.video-container .player-wrapper,
.video-container .video-thumbnail,
.video-container .video-play-btn {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Active player state */
.video-container.player-active {
    z-index: 100;
}

/* YouTube player styling */
.player-wrapper iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* Make sure YouTube controls are visible */
.player-wrapper .ytp-chrome-top {
    opacity: 1 !important;
}

/* Audio indicator */
.audio-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 30;
    display: none;
}

.video-container.player-active .audio-indicator {
    display: block;
}
/* Add to media_components.css or create new loading.css */

/* Video Loading Styles */
.video-loading-pro {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 25 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: inherit !important;
    animation: fadeIn 0.3s ease-out !important;
}

/* Enhanced play button */
.video-play-btn {
    cursor: pointer !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 70px !important;
    height: 70px !important;
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    border: 3px solid white !important;
    border-radius: 50% !important;
    color: white !important;
    font-size: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 10 !important;
    box-shadow:
        0 10px 30px rgba(124, 58, 237, 0.4),
        0 0 0 8px rgba(124, 58, 237, 0.2) !important;
}

.video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.15) !important;
    box-shadow:
        0 15px 40px rgba(124, 58, 237, 0.6),
        0 0 0 12px rgba(124, 58, 237, 0.3) !important;
}

/* Player wrapper */
.player-wrapper-pro {
    border-radius: inherit !important;
    overflow: hidden !important;
}

/* YouTube player styling */
.player-wrapper-pro iframe {
    border-radius: inherit !important;
}

/* Fullscreen styles */
.video-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000 !important;
    border-radius: 0 !important;
}

.video-container:fullscreen .player-wrapper-pro {
    width: 100% !important;
    height: 100% !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-play-btn {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.3rem !important;
    }

    .video-loading-pro {
        padding: 20px !important;
    }

    .loading-center {
        width: 60px !important;
        height: 60px !important;
    }

    .loading-spinner-pro {
        width: 40px !important;
        height: 40px !important;
        top: 5px !important;
        left: 5px !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin-smooth {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Loading spinner */
.loading-spinner-pro {
    animation: spin-smooth 1s linear infinite !important;
}

.pulse-ring {
    animation: pulse-ring 1.5s ease-out infinite !important;
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 25%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 75%
    ) !important;
    background-size: 200% 100% !important;
    animation: shimmer 1.5s infinite !important;
}

/* Error states */
.video-container.error .video-play-btn {
    background: linear-gradient(135deg, var(--error), #dc2626) !important;
}

.video-container.loading .video-play-btn {
    opacity: 0.5 !important;
    cursor: wait !important;
}

/* Accessibility */
.video-play-btn:focus {
    outline: 3px solid var(--primary-light) !important;
    outline-offset: 3px !important;
}

.video-container:focus-within {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}
/* Add to your CSS file */
.video-loading-pro {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    z-index: 25 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: inherit !important;
    animation: fadeIn 0.3s ease-out !important;
    transition: opacity 0.3s ease !important;
}

.video-loading-pro.hiding {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Add smooth transition for player elements */
.video-container .video-thumbnail,
.video-container .video-play-btn,
.video-container .player-wrapper-pro,
.video-container .video-overlay {
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

/* When player is active */
.video-container.player-active .video-thumbnail,
.video-container.player-active .video-play-btn {
    opacity: 0 !important;
    pointer-events: none !important;
}

.video-container.player-active .player-wrapper-pro {
    opacity: 1 !important;
}

/* Ensure loading is always on top when visible */
.video-loading-pro:not(.hiding) {
    z-index: 30 !important;
}

/* Debug styles (remove in production) */
.debug-border {
    border: 2px solid red !important;
}
/* ===== VIDEO MANAGER FIXES ===== */

/* Fix black screen issue - مهمترین بخش */
.video-container .player-wrapper {
    background: #000 !important;
    z-index: 20 !important;
}

.video-container .player-wrapper iframe {
    background: #000 !important;
}

/* Ensure proper z-index layering */
.video-container {
    z-index: 1;
}

.video-container.playing {
    z-index: 10;
}

/* Fix loading spinner position */
.video-loading {
    z-index: 25;
}

/* Fix error message positioning */
.video-error {
    z-index: 30;
}

/* Ensure thumbnail doesn't show behind player */
.video-container.playing .video-thumbnail {
    display: none !important;
}

/* Fix for YouTube player controls */
.player-wrapper .ytp-chrome-top {
    opacity: 1 !important;
    transition: opacity 0.3s ease !important;
}

.player-wrapper:hover .ytp-chrome-top {
    opacity: 1 !important;
}

/* Fullscreen fixes */
.video-container:fullscreen {
    background: #000 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.video-container:fullscreen .player-wrapper {
    width: 100% !important;
    height: 100% !important;
}

/* Smooth transitions */
.video-thumbnail,
.video-play-btn,
.player-wrapper,
.video-loading,
.video-overlay {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Prevent flash of white background */
.video-container {
    background: #000;
}

/* Fix for Safari/iOS */
@supports (-webkit-touch-callout: none) {
    .video-container .player-wrapper iframe {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}
/* ===== FIXES FOR CAROUSEL AND IMAGE ===== */

/* Fix for image container - ensure image fits perfectly */
.image-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
    position: relative;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-image:hover {
    transform: scale(1.05);
}

/* Fix for carousel slides */
.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    min-width: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Fix carousel counter position */
.carousel-counter {
    position: absolute;
    bottom: 15px; /* از 20px به 15px تغییر دادم */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Adjust carousel dots position */
.carousel-dots {
    position: absolute;
    bottom: 45px; /* از 60px به 45px تغییر دادم */
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 15;
    padding: 0 10px;
}

/* Ensure media containers don't overflow */
.post-media-section {
    position: relative;
    height: 340px;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: var(--radius-lg);
}

/* Fix for post-card height consistency */
.post-card {
    height: 620px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== PROFESSIONAL PLAY BUTTON ===== */

/* Modern Professional Play Button */
.video-play-btn-pro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.95),
        rgba(220, 38, 38, 0.95));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 20;
    box-shadow:
        0 0 0 0 rgba(239, 68, 68, 0.7),
        0 15px 35px rgba(0, 0, 0, 0.4);
    opacity: 0.9;
    overflow: hidden;
}

.video-play-btn-pro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.video-play-btn-pro:hover {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
    box-shadow:
        0 0 0 15px rgba(239, 68, 68, 0.2),
        0 20px 45px rgba(0, 0, 0, 0.5);
}

.video-play-btn-pro:hover::before {
    transform: translateX(100%);
}

.video-play-btn-pro:active {
    transform: translate(-50%, -50%) scale(0.95);
    transition: transform 0.1s ease;
}

/* Play button pulse animation */
@keyframes professionalPulse {
    0% {
        box-shadow:
            0 0 0 0 rgba(239, 68, 68, 0.4),
            0 15px 35px rgba(0, 0, 0, 0.4);
    }
    70% {
        box-shadow:
            0 0 0 20px rgba(239, 68, 68, 0),
            0 20px 45px rgba(0, 0, 0, 0.5);
    }
    100% {
        box-shadow:
            0 0 0 0 rgba(239, 68, 68, 0),
            0 15px 35px rgba(0, 0, 0, 0.4);
    }
}

.video-play-btn-pro.pulse {
    animation: professionalPulse 2s infinite;
}

/* Play button shine effect */
@keyframes buttonShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.video-play-btn-pro.shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 20%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 80%
    );
    transform: rotate(45deg);
    animation: buttonShine 3s infinite;
}

/* Triangle play icon */
.video-play-btn-pro .play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    left: 3px; /* برای وسط‌چین شدن مثلث */
}

.video-play-btn-pro .play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 18px solid white;
}

/* Hover effect for triangle */
.video-play-btn-pro:hover .play-icon::before {
    border-left-color: rgba(255, 255, 255, 0.9);
}

/* Alternative: Font Awesome icon with animation */
.video-play-btn-pro.fa-icon {
    font-family: 'Font Awesome 6 Pro', 'Font Awesome 6 Free', sans-serif;
}

.video-play-btn-pro.fa-icon i {
    font-size: 2.5rem;
    transition: transform 0.3s ease;
}

.video-play-btn-pro.fa-icon:hover i {
    transform: scale(1.1);
}

/* Responsive play button */
@media (max-width: 768px) {
    .video-play-btn-pro {
        width: 65px;
        height: 65px;
        font-size: 1.7rem;
    }

    .video-play-btn-pro .play-icon::before {
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-left: 15px solid white;
    }
}

@media (max-width: 480px) {
    .video-play-btn-pro {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }

    .video-play-btn-pro .play-icon::before {
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-left: 12px solid white;
    }
}

/* Play button loading state */
.video-play-btn-pro.loading {
    opacity: 0.6;
    cursor: wait;
    animation: none;
}

.video-play-btn-pro.loading .play-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Play button success state (after playing) */
.video-play-btn-pro.played {
    background: linear-gradient(135deg,
        rgba(34, 197, 94, 0.95),
        rgba(21, 128, 61, 0.95));
}

/* Play button error state */
.video-play-btn-pro.error {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.8),
        rgba(185, 28, 28, 0.8));
}

/* ===== ENHANCED VIDEO OVERLAY ===== */

.video-overlay-pro {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        transparent 100%);
    color: white;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-info-pro {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.video-duration-badge-pro {
    padding: 0.35rem 0.8rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 10;
}

.video-views-pro {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ===== MEDIA CONTAINER FIXES ===== */

/* Ensure all media containers have same aspect ratio */
.video-container,
.carousel-container,
.image-container {
    aspect-ratio: 16/9;
    height: 340px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Fix for mobile responsiveness */
@media (max-width: 768px) {
    .post-media-section {
        height: 300px;
    }

    .video-container,
    .carousel-container,
    .image-container {
        height: 300px;
    }

    .carousel-counter {
        bottom: 10px;
        padding: 4px 12px;
        font-size: 12px;
    }

    .carousel-dots {
        bottom: 40px;
    }
}

@media (max-width: 640px) {
    .post-media-section {
        height: 260px;
    }

    .video-container,
    .carousel-container,
    .image-container {
        height: 260px;
    }
}

/* Fix for image loading */
.image-container.loading {
    background: linear-gradient(90deg,
        var(--glass) 25%,
        var(--glass-light) 50%,
        var(--glass) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Ensure carousel images don't stretch */
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Fix for carousel track */
.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Add smooth transition for carousel */
.carousel-slide {
    transition: opacity 0.3s ease;
}

.carousel-slide:not(.active) {
    opacity: 0.7;
}

.carousel-slide.active {
    opacity: 1;
}

/* ===== ENHANCED HOVER EFFECTS ===== */

.video-container:hover .video-thumbnail,
.carousel-container:hover .carousel-slide img,
.image-container:hover .post-image {
    transform: scale(1.03);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add overlay on hover */
.video-container::before,
.carousel-container::before,
.image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
}

.video-container:hover::before,
.carousel-container:hover::before,
.image-container:hover::before {
    opacity: 1;
}

/* ===== FIX FOR CAROUSEL NAVIGATION ===== */

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.carousel-container:hover .carousel-nav {
    opacity: 0.9;
}

.carousel-nav:hover {
    background: var(--primary);
    border-color: var(--primary-light);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 20px rgba(124, 58, 237, 0.4);
}

.carousel-prev {
    right: 12px;
}

.carousel-next {
    left: 12px;
}

/* ===== FIX FOR CAROUSEL DOTS ===== */

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    flex-shrink: 0;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--primary-light);
    width: 22px;
    border-radius: 6px;
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.5);
}

/* Touch area for dots */
.carousel-dot::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

.video-play-btn-pro:focus,
.carousel-nav:focus,
.carousel-dot:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: more) {
    .video-play-btn-pro {
        border: 2px solid white;
    }

    .carousel-nav {
        border: 2px solid white;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .video-play-btn-pro,
    .video-thumbnail,
    .post-image,
    .carousel-slide img {
        transition: none;
    }

    .video-play-btn-pro.pulse {
        animation: none;
    }

    .carousel-track {
        transition: none;
    }
}
/* ===== SUPER MODERN PLAY BUTTON ===== */

/* Modern Play Button Container */
.video-play-btn-modern {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg,
        #ff2e2e, /* قرمز روشن */
        #d10000, /* قرمز تیره */
        #ff2e2e 70%, /* قرمز روشن */
        #ff6b6b /* قرمز صورتی */
    );
    background-size: 300% 300%;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 20;
    box-shadow:
        0 0 20px rgba(255, 46, 46, 0.4),
        0 0 40px rgba(255, 46, 46, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: gradientShift 3s ease infinite,
               floatAnimation 3s ease-in-out infinite;
    overflow: hidden;
}

/* Hover Effects */
.video-play-btn-modern:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow:
        0 0 30px rgba(255, 46, 46, 0.6),
        0 0 60px rgba(255, 46, 46, 0.3),
        0 0 100px rgba(255, 46, 46, 0.1),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    animation: gradientShift 1.5s ease infinite,
               floatAnimation 2s ease-in-out infinite,
               pulseGlow 1.5s ease infinite;
}

.video-play-btn-modern:active {
    transform: translate(-50%, -50%) scale(0.95);
    transition: transform 0.1s ease;
}

/* Play Icon (Modern Triangle) */
.video-play-btn-modern .play-icon {
    position: relative;
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 25px solid white;
    margin-left: 5px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.video-play-btn-modern:hover .play-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Shine Effect */
.video-play-btn-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 55%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shine 3s linear infinite;
}

/* Outer Ring */
.video-play-btn-modern::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid rgba(255, 46, 46, 0.3);
    border-radius: 50%;
    animation: ringPulse 2s ease-out infinite;
    z-index: -1;
}

/* Floating Dots Animation */
.video-play-btn-modern .floating-dots {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
}

.video-play-btn-modern .floating-dots span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: floatUp 3s linear infinite;
}

.video-play-btn-modern .floating-dots span:nth-child(1) {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.video-play-btn-modern .floating-dots span:nth-child(2) {
    top: 70%;
    left: 80%;
    animation-delay: 0.5s;
}

.video-play-btn-modern .floating-dots span:nth-child(3) {
    top: 40%;
    left: 10%;
    animation-delay: 1s;
}

.video-play-btn-modern .floating-dots span:nth-child(4) {
    top: 20%;
    left: 70%;
    animation-delay: 1.5s;
}

.video-play-btn-modern .floating-dots span:nth-child(5) {
    top: 85%;
    left: 30%;
    animation-delay: 2s;
}

/* Loading State */
.video-play-btn-modern.loading {
    animation: gradientShift 1s ease infinite,
               spin 1s linear infinite;
    cursor: wait;
}

.video-play-btn-modern.loading .play-icon {
    animation: pulseIcon 1s ease infinite;
}

/* Success State (After Play) */
.video-play-btn-modern.played {
    background: linear-gradient(135deg,
        #00b894, /* سبز */
        #00a085,
        #00b894 70%,
        #55efc4
    );
    box-shadow:
        0 0 20px rgba(0, 184, 148, 0.4),
        0 0 40px rgba(0, 184, 148, 0.2);
    animation: gradientShift 3s ease infinite,
               successPulse 2s ease infinite;
}

.video-play-btn-modern.played::after {
    border-color: rgba(0, 184, 148, 0.3);
    animation: ringPulse 2s ease-out infinite;
}

/* ===== ANIMATIONS ===== */

/* Gradient Shift Animation */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Floating Animation */
@keyframes floatAnimation {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-5px);
    }
}

/* Pulse Glow on Hover */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow:
            0 0 30px rgba(255, 46, 46, 0.6),
            0 0 60px rgba(255, 46, 46, 0.3),
            0 0 100px rgba(255, 46, 46, 0.1);
    }
    50% {
        box-shadow:
            0 0 40px rgba(255, 46, 46, 0.8),
            0 0 80px rgba(255, 46, 46, 0.4),
            0 0 120px rgba(255, 46, 46, 0.2);
    }
}

/* Shine Animation */
@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Ring Pulse Animation */
@keyframes ringPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    70% {
        transform: scale(1.2);
        opacity: 0;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Floating Dots Animation */
@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
}

/* Spin Animation for Loading */
@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Pulse Icon Animation */
@keyframes pulseIcon {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Success Pulse Animation */
@keyframes successPulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(0, 184, 148, 0.4),
            0 0 40px rgba(0, 184, 148, 0.2);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        box-shadow:
            0 0 30px rgba(0, 184, 148, 0.6),
            0 0 60px rgba(0, 184, 148, 0.3);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .video-play-btn-modern {
        width: 65px;
        height: 65px;
    }

    .video-play-btn-modern .play-icon {
        border-top: 12px solid transparent;
        border-bottom: 12px solid transparent;
        border-left: 20px solid white;
    }

    .video-play-btn-modern::after {
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
    }
}

@media (max-width: 480px) {
    .video-play-btn-modern {
        width: 55px;
        height: 55px;
    }

    .video-play-btn-modern .play-icon {
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-left: 16px solid white;
    }

    .video-play-btn-modern::after {
        top: -6px;
        left: -6px;
        right: -6px;
        bottom: -6px;
    }
}

/* ===== REDUCED MOTION SUPPORT ===== */

@media (prefers-reduced-motion: reduce) {
    .video-play-btn-modern,
    .video-play-btn-modern::before,
    .video-play-btn-modern::after,
    .video-play-btn-modern .floating-dots span,
    .video-play-btn-modern .play-icon {
        animation: none !important;
        transition: none !important;
    }

    .video-play-btn-modern:hover {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* ===== DARK MODE ENHANCEMENTS ===== */

@media (prefers-color-scheme: dark) {
    .video-play-btn-modern {
        background: linear-gradient(135deg,
            #ff4757, /* قرمز روشن برای تاریک */
            #ff3838,
            #ff4757 70%,
            #ff6b81
        );
        box-shadow:
            0 0 25px rgba(255, 71, 87, 0.5),
            0 0 50px rgba(255, 71, 87, 0.3),
            inset 0 0 25px rgba(255, 255, 255, 0.15);
    }

    .video-play-btn-modern:hover {
        box-shadow:
            0 0 35px rgba(255, 71, 87, 0.7),
            0 0 70px rgba(255, 71, 87, 0.4),
            0 0 120px rgba(255, 71, 87, 0.2);
    }

    .video-play-btn-modern .play-icon {
        filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
    }
}

/* ===== ACCESSIBILITY ===== */

.video-play-btn-modern:focus {
    outline: none;
}

.video-play-btn-modern:focus-visible {
    outline: 3px solid rgba(255, 46, 46, 0.8);
    outline-offset: 4px;
    box-shadow:
        0 0 0 8px rgba(255, 46, 46, 0.2),
        0 0 30px rgba(255, 46, 46, 0.6);
}

/* ===== PRINT STYLES ===== */

@media print {
    .video-play-btn-modern {
        display: none !important;
    }
}
/* ===== VIDEO PLAYER ENHANCEMENTS ===== */

/* Fullscreen support */
.video-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: #000 !important;
    border-radius: 0 !important;
}

.video-container:fullscreen .player-container {
    width: 100% !important;
    height: 100% !important;
}

/* Controls visibility */
.player-wrapper:hover .ytp-chrome-top,
.player-wrapper:hover .ytp-chrome-bottom {
    opacity: 1 !important;
}

/* Custom controls */
.custom-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-container:hover .custom-video-controls {
    opacity: 1;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
}

.control-btn:hover {
    transform: scale(1.1);
    color: var(--primary-light);
}

.time-display {
    color: white;
    font-size: 14px;
    font-family: monospace;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s ease;
}

/* Volume control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
}

.volume-fill {
    height: 100%;
    background: var(--primary-light);
    width: 80%;
    border-radius: 2px;
}

/* Quality selector */
.quality-selector {
    position: relative;
}

.quality-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.quality-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 4px;
    padding: 5px 0;
    min-width: 100px;
    display: none;
}

.quality-selector:hover .quality-menu {
    display: block;
}

.quality-option {
    padding: 8px 12px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.quality-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.quality-option.active {
    color: var(--primary-light);
    font-weight: 600;
}
/* اضافه به media_components.css */

/* ===== PROFESSIONAL LOADING STYLES ===== */

.video-player-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 30;
    border-radius: inherit;
    overflow: hidden;
}

/* Professional Loading Container */
.professional-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    backdrop-filter: blur(20px);
    animation: fadeIn 0.3s ease-out;
}

.loading-container {
    text-align: center;
    color: white;
    max-width: 300px;
    padding: 30px;
}

/* Spinner Rings */
.spinner-ring {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    margin: 0 auto 30px;
    position: relative;
}

.spinner-ring-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

.spinner-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Loading Text */
.loading-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.95);
    animation: textFade 2s ease-in-out infinite;
}

.loading-subtext {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
    opacity: 0.8;
}

/* Progress Bar */
.loading-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

.progress-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Courier New', monospace;
}

/* Custom Controls */
.custom-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player-area:hover .custom-controls {
    opacity: 1;
}

.control-btn {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

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

.close-btn {
    background: rgba(239, 68, 68, 0.8);
}

.close-btn:hover {
    background: rgba(220, 38, 38, 0.9);
}

.fullscreen-btn {
    background: rgba(59, 130, 246, 0.8);
}

.fullscreen-btn:hover {
    background: rgba(37, 99, 235, 0.9);
}

/* Player Wrapper */
.player-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Ensure iframe/video fills container */
.player-wrapper iframe,
.player-wrapper video {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background: #000 !important;
    border-radius: inherit !important;
}

/* Animation for player appear */
@keyframes playerAppear {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.video-player-area.active {
    animation: playerAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Video container states */
.video-container.playing .video-thumbnail-wrapper,
.video-container.playing .video-play-btn,
.video-container.playing .video-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.4s ease !important;
}

/* Thumbnail overlay for text readability */
.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 2;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* ===== ANIMATIONS ===== */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes textFade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive loading */
@media (max-width: 768px) {
    .loading-container {
        max-width: 250px;
        padding: 20px;
    }

    .spinner-ring {
        width: 60px;
        height: 60px;
        margin-bottom: 20px;
    }

    .spinner-ring-2 {
        width: 45px;
        height: 45px;
    }

    .spinner-core {
        width: 15px;
        height: 15px;
    }

    .loading-text {
        font-size: 16px;
    }

    .loading-subtext {
        font-size: 12px;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}
/* static/css/video_player_enhanced.css */
/* ===== ENHANCED VIDEO PLAYER STYLES ===== */

/* Professional Loading Animation */
.video-loading-pro {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(15, 23, 42, 0.95),
        rgba(30, 41, 59, 0.95));
    backdrop-filter: blur(15px);
    border-radius: inherit;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.video-loading-pro.hiding {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Loading Spinner */
.loading-center {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.loading-spinner-pro {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid #3b82f6;
    border-right: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.pulse-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid rgba(59, 130, 246, 0.4);
    border-radius: 50%;
    animation: pulse 1.5s ease-out infinite;
}

/* Loading Text */
.loading-text-pro {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin-top: 15px;
    text-align: center;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #3b82f6);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 2s ease infinite;
}

/* Progress Bar */
.loading-progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
}

.loading-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.loading-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent);
    animation: shimmer 1.5s infinite;
}

/* Player Wrapper Styles */
.player-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 25;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: #000;
    border-radius: inherit;
    overflow: hidden;
}

.player-wrapper.ready {
    opacity: 1;
}

/* YouTube Player Styling */
.youtube-player-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.youtube-player-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
    background: #000 !important;
}

/* Close Button */
.close-player-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
}

.video-container.playing .close-player-btn {
    opacity: 1;
    animation: slideInDown 0.3s ease-out;
}

.close-player-btn:hover {
    background: rgba(220, 38, 38, 0.95);
    transform: scale(1.1);
}

.close-player-btn:active {
    transform: scale(0.95);
}

/* Video State Management */
.video-container.playing .player-wrapper {
    opacity: 1;
}

.video-container.playing .video-thumbnail,
.video-container.playing .video-play-btn,
.video-container.playing .video-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.4s ease !important;
}

/* Video Container States */
.video-container.loading .video-play-btn {
    opacity: 0.6;
    cursor: wait;
}

/* Error State */
.video-error-state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(15, 23, 42, 0.95),
        rgba(239, 68, 68, 0.1));
    backdrop-filter: blur(10px);
    border-radius: inherit;
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.error-icon {
    font-size: 40px;
    color: #ef4444;
    margin-bottom: 15px;
}

.error-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.error-message {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 20px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .loading-center {
        width: 60px;
        height: 60px;
    }

    .loading-text-pro {
        font-size: 12px;
    }

    .close-player-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .video-container .player-wrapper,
    .video-container .video-loading-pro,
    .video-container .close-player-btn {
        display: none !important;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .video-loading-pro,
    .loading-spinner-pro,
    .pulse-ring,
    .close-player-btn,
    .player-wrapper {
        animation: none !important;
        transition: opacity 0.3s ease !important;
    }
}
/* static/css/video_fixes.css */
/* ===== FIXES FOR VIDEO DISPLAY ISSUES ===== */

/* حذف دیسپلی نان از player-container */
.video-container .player-container {
    display: block !important; /* تغییر از none به block */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.video-container.playing .player-container {
    opacity: 1;
    pointer-events: auto;
    z-index: 20;
}

/* تامبنیل باید همیشه زیر player باشد */
.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.video-container.playing .video-thumbnail {
    opacity: 0;
}

/* ویدیو پلیر باید کل فضا را پر کند */
.player-wrapper {
    width: 100% !important;
    height: 100% !important;
    background: #000;
    position: relative;
}

.youtube-player-container,
.player-wrapper iframe,
.player-wrapper video {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    border: none !important;
    display: block !important;
    background: #000 !important;
}

/* Play button باید بالای تامبنیل باشد */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 35px rgba(239, 68, 68, 0.7);
}

.video-container.playing .video-play-btn {
    opacity: 0;
    pointer-events: none;
}

/* Overlay باید زیر play button باشد */
.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    z-index: 7;
    pointer-events: none;
}

.video-container.playing .video-overlay {
    opacity: 0;
}

/* Loading باید بالای همه باشد */
.video-loading-pro {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-loading-pro.active {
    opacity: 1;
    pointer-events: auto;
}

/* Close button */
.close-player-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.video-container.playing .close-player-btn {
    opacity: 1;
    transform: translateY(0);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure proper stacking order */
.video-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.video-container > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
/* static/css/thumbnail_styles.css */
.thumbnail-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.default-thumbnail {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 3rem;
}

.duration-badge {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Ensure thumbnail is visible */
.video-container:not(.playing) .thumbnail-container {
    opacity: 1;
    visibility: visible;
}

.video-container.playing .thumbnail-container {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* static/css/video_thumbnails.css */
.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.thumbnail-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-container.playing .thumbnail-container {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
/* اضافه کن به media_components.css */
.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    min-width: 100%;
    position: relative;
}

/* تغییر مهم اینجاست: object-fit به contain تغییر میکنه */
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* تغییر از cover به contain */
    object-position: center;
    display: block;
    background: #000; /* برای فضاهای خالی */
}

/* برای موبایل بهتر است contain باشه */
@media (max-width: 768px) {
    .carousel-slide img {
        object-fit: contain;
    }
}

/* اگر می‌خواهید تصاویر کاملاً پر کنند با حفظ aspect ratio */
.carousel-slide.full-cover img {
    object-fit: cover;
}

/* Loading برای تصاویر */
.carousel-slide.loading {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
/* ===== CAROUSEL FIXES ===== */

.carousel-container {
    position: relative;
    width: 100%;
    height: 340px; /* ارتفاع ثابت */
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000; /* پس‌زمینه مشکی برای حاشیه‌ها */
    isolation: isolate;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    min-width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000; /* پیش‌زمینه مشکی */
}

/* کانتینر عکس */
.carousel-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #000; /* پس‌زمینه مشکی */
}

/* تصویر با object-fit: contain برای نمایش کامل */
.carousel-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain !important; /* نمایش کامل تصویر */
    display: block;
    background: #000; /* برای فضاهای خالی */
}

/* برای حالت cover (اختیاری) */
.carousel-slide img.cover-mode {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
}

/* Loading state */
.carousel-slide.loading .carousel-image-container {
    background: linear-gradient(90deg,
        rgba(30, 41, 59, 0.7) 25%,
        rgba(51, 65, 85, 0.7) 50%,
        rgba(30, 41, 59, 0.7) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* دکمه‌های ناوبری */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.carousel-container:hover .carousel-nav {
    opacity: 0.9;
}

.carousel-prev {
    right: 16px;
    left: auto;
}

.carousel-next {
    left: 16px;
    right: auto;
}

/* شمارنده */
.carousel-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* نقاط ناوبری */
.carousel-dots {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 15;
    padding: 0 10px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-container {
        height: 280px;
    }

    .carousel-nav {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .carousel-counter {
        bottom: 15px;
        font-size: 0.8rem;
    }

    .carousel-dots {
        bottom: 50px;
    }
}
