/* ========================================
   ADVANCED UI/UX ENHANCEMENTS
   - Smooth Animations
   - Parallax Effects
   - Modern Card Interactions
   - SEO-Optimized Performance
======================================== */

/* ========================================
   1. SMOOTH CARD HOVER EFFECTS
======================================== */
.video-card {
    will-change: transform, box-shadow;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.video-card:hover {
    transform: translateY(-12px) scale(1.05);
    box-shadow:
        0 25px 50px rgba(255, 193, 7, 0.25),
        0 10px 20px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.video-card .thumbnail {
    position: relative;
    overflow: hidden;
}

.video-card .thumbnail::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 193, 7, 0.15) 50%,
            transparent 70%);
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card:hover .thumbnail::before {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

.video-card .thumbnail img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card:hover .thumbnail img {
    transform: scale(1.1) rotate(1deg);
}

/* ========================================
   2. PARALLAX HERO SECTION
======================================== */
.hero-banner {
    position: relative;
    overflow: hidden;
}

.hero-bg {
    transition: transform 0.1s ease-out;
}

.parallax-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.parallax-layer-1 {
    transform: translateZ(0);
    will-change: transform;
}

/* ========================================
   3. ANIMATED GRADIENT BACKGROUNDS
======================================== */
@keyframes gradientShift {

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

    50% {
        background-position: 100% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

.accent-gradient {
    background: linear-gradient(135deg,
            #ffc107 0%,
            #ffb300 25%,
            #ffc107 50%,
            #ff9500 75%,
            #ffc107 100%);
}

/* ========================================
   4. SMOOTH PAGE TRANSITIONS
======================================== */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

/* ========================================
   5. ENHANCED LOADING STATES
======================================== */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 0%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

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

    100% {
        background-position: -200% 0;
    }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ========================================
   6. SCROLL-TRIGGERED ANIMATIONS
======================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================
   7. MODERN GLASSMORPHISM
======================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 193, 7, 0.3);
    box-shadow:
        0 12px 48px rgba(255, 193, 7, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ========================================
   8. SMOOTH BADGE ANIMATIONS
======================================== */
.badge-type {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, var(--accent), #ffb300) !important;
}

.video-card:hover .badge-type {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.4);
}

/* ========================================
   9. ENHANCED BUTTONS
======================================== */
.btn-primary,
.btn-outline {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn-primary::before,
.btn-outline::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 50%,
            rgba(255, 255, 255, 0.1) 100%);
    transform: translateX(-100%) skewX(-15deg);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.btn-primary:hover::before,
.btn-outline:hover::before {
    transform: translateX(100%) skewX(-15deg);
}

.btn-primary:active,
.btn-outline:active {
    transform: scale(0.95);
}

/* ========================================
   10. MICRO-INTERACTIONS
======================================== */
.interactive-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.interactive-icon:hover {
    transform: rotate(10deg) scale(1.1);
}

.interactive-icon:active {
    transform: rotate(-10deg) scale(0.9);
}

/* ========================================
   11. SEARCH BOX ENHANCEMENT
======================================== */
.search-box:focus-within {
    transform: scale(1.02);
    box-shadow:
        0 8px 24px rgba(255, 193, 7, 0.3),
        0 0 0 3px rgba(255, 193, 7, 0.1);
}

.search-box input:focus {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* ========================================
   12. PROGRESS BAR ANIMATION
======================================== */
.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 100%);
    animation: progressShine 2s ease-in-out infinite;
}

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

    100% {
        transform: translateX(100%);
    }
}

/* ========================================
   13. SIDEBAR ENHANCEMENT
======================================== */
.sidebar-item {
    position: relative;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    background: var(--accent);
    transform: translateY(-50%);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-item:hover::before {
    height: 70%;
}

/* ========================================
   14. TOAST NOTIFICATIONS IMPROVEMENT
======================================== */
.toast {
    animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        toastSlideOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) 3.6s;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ========================================
   15. PERFORMANCE OPTIMIZATIONS
======================================== */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Critical above-the-fold content */
.critical-content {
    content-visibility: auto;
    contain-intrinsic-size: 300px;
}

/* Lazy-loaded images */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s ease-in;
}

/* ========================================
   16. DARK MODE ENHANCEMENTS (Future-ready)
======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #aaaaaa;
        --bg-primary: #050505;
    }
}

/* ========================================
   17. RESPONSIVE IMPROVEMENTS
======================================== */
@media (max-width: 768px) {
    .video-card:hover {
        transform: translateY(-4px) scale(1.01);
    }

    .fade-in-up,
    .scale-in,
    .slide-in-left,
    .slide-in-right {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   18. REDUCED MOTION SUPPORT (Accessibility)
======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   19. SCROLL TO TOP BUTTON
======================================== */
.scroll-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #ffb300 100%);
    border: none;
    color: #0a0e27;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 0 8px 24px rgba(255, 193, 7, 0.4);
    font-weight: 700;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-to-top:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 12px 32px rgba(255, 193, 7, 0.6);
}

.scroll-to-top:active {
    transform: translateY(-1px) scale(1.05);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 90px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}


/* ========================================
   21. PULL TO REFRESH INDICATOR (Mobile)
======================================== */
.pull-refresh-indicator {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent) 0%, #ffb300 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0e27;
    font-size: 20px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
    font-weight: 700;
}

.pull-refresh-indicator.refreshing i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   22. ENHANCED SEARCH SUGGESTIONS
======================================== */
.search-suggestions {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.suggestion-item:hover {
    background: rgba(255, 193, 7, 0.1);
    transform: translateX(5px);
    border-left: 3px solid var(--accent);
    padding-left: 12px;
}

/* ========================================
   23. STAGGER ANIMATION FOR GRIDS
======================================== */
.grid-item-wrapper {
    animation: fadeInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.grid-item-wrapper:nth-child(1) {
    animation-delay: 0.05s;
}

.grid-item-wrapper:nth-child(2) {
    animation-delay: 0.1s;
}

.grid-item-wrapper:nth-child(3) {
    animation-delay: 0.15s;
}

.grid-item-wrapper:nth-child(4) {
    animation-delay: 0.2s;
}

.grid-item-wrapper:nth-child(5) {
    animation-delay: 0.25s;
}

.grid-item-wrapper:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========================================
   24. AMBIENT GLOW ENHANCEMENT
======================================== */
#ambient-glow {
    filter: blur(100px);
    opacity: 0.4;
    transition: all 1s ease;
    animation: ambientPulse 8s ease-in-out infinite;
}

@keyframes ambientPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* ========================================
   25. ENHANCED EPISODE BUTTONS
======================================== */
.episodes-container {
    background: rgba(26, 31, 58, 0.6);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 193, 7, 0.1);
}

.episodes-container h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.episodes-container h3 i {
    color: var(--accent);
}

.episodes-container h4 {
    color: #aaa;
    font-size: 14px;
    font-weight: 500;
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.episodes-container h4::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--accent);
    border-radius: 2px;
}

.ep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.ep-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    user-select: none;
}

.ep-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #ffb300);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ep-btn:hover {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.ep-btn:hover::before {
    transform: scaleX(1);
}

.ep-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, #ffb300 100%);
    border-color: var(--accent);
    color: #0a0e27;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.4);
    font-weight: 600;
}

.ep-btn.active::before {
    transform: scaleX(1);
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
}

.ep-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.ep-btn:active::after {
    width: 200%;
    height: 200%;
}

.ep-btn:active {
    transform: translateY(0) scale(0.95);
}

@media (max-width: 768px) {
    .episodes-container {
        padding: 15px;
        border-radius: 10px;
    }

    .ep-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
    }

    .ep-btn {
        padding: 10px 6px;
        font-size: 13px;
    }
}

/* ========================================
   26. IMAGE LOADING ANIMATIONS
======================================== */
.img-loading {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.img-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 193, 7, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1;
}

.img-loaded::after {
    content: '';
    display: none;
}

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

    100% {
        background-position: 200% 0;
    }
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.img-loaded {
    animation: fadeInImage 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.video-card img,
.hero-card img,
.sidebar-item img,
.related-card img {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-card img.img-loading,
.hero-card img.img-loading,
.sidebar-item img.img-loading,
.related-card img.img-loading {
    opacity: 0;
}

.video-card img.img-loaded,
.hero-card img.img-loaded,
.sidebar-item img.img-loaded,
.related-card img.img-loaded {
    opacity: 1;
}

/* Skeleton placeholder for images */
.skeleton-img {
    background: linear-gradient(90deg,
            rgba(30, 30, 30, 0.3) 0%,
            rgba(45, 45, 45, 0.3) 50%,
            rgba(30, 30, 30, 0.3) 100%);
    background-size: 200% 100%;
    animation: none;
    position: relative;
}

.skeleton-img::before {
    content: '';
    display: none;
}

.related-card .thumbnail.skeleton-img {
    background: transparent;
    animation: none;
}

.related-card img {
    position: relative;
    z-index: 2;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

/* ========================================
   27. PRINT STYLES (SEO & Accessibility)
======================================== */
@media print {

    .navbar,
    .bottom-nav,
    .sidebar,
    .hero-banner,
    .toast,
    .scroll-to-top,
    .custom-cursor,
    .cursor-follower,
    .pull-refresh-indicator,
    button {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .video-card,
    .glass-card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ========================================
   27. NUMERICAL PAGINATION STYLES
======================================== */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.page-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.page-btn:hover {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, #ffb300 100%);
    color: #0a0e27;
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.4);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.page-dots {
    color: #666;
    font-weight: 700;
    padding: 0 4px;
}

@media (max-width: 768px) {
    .page-btn {
        padding: 6px 12px;
        font-size: 13px;
        min-width: 35px;
    }
}