@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --accent-color: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.4);
    --bg-dark: #07090f;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
}

body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    background-color: var(--bg-dark);
    color: #e2e8f0;
    overflow-x: hidden;
}

/* Premium Dynamic Background */
#mouse-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(245, 158, 11, 0.08), transparent 40%);
    transition: background 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 0% 0%, rgba(245, 158, 11, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 1) 0%, var(--bg-dark) 100%);
    z-index: -1;
}

/* Glassmorphism 2.0 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card-premium {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.glass-nav {
    background: rgba(7, 9, 15, 0.7);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 50;
    transition: all 0.4s ease;
}

.glass-nav.scrolled {
    background: rgba(7, 9, 15, 0.95);
    padding: 0.5rem 0;
}


/* Enhanced Movie Card */
.movie-card {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    background: #0f172a;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.movie-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 50%, rgba(245, 158, 11, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.5s ease;
}

.movie-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.15);
}

.movie-card:hover::after {
    opacity: 1;
}

.movie-card-overlay {
    background: linear-gradient(to top,
            rgba(7, 9, 15, 0.98) 0%,
            rgba(7, 9, 15, 0.8) 30%,
            transparent 100%);
}

/* Global Loading Bar */
#loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, #f59e0b, #fbbf24);
    box-shadow: 0 0 10px var(--accent-glow);
    width: 0;
    z-index: 9999;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.text-gradient-amber {
    background: linear-gradient(to l, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-on-scroll.active {
    opacity: 1;
    transform: translateY(0);
}

/* Premium Gradient Text */
.text-premium-gradient {
    background: linear-gradient(135deg, #fff 0%, #f59e0b 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: textGradient 5s linear infinite;
}

@keyframes textGradient {
    0% {
        background-position: 0% center;
    }

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


/* skeleton refined */
.skeleton {
    background: linear-gradient(90deg, #0f172a 25%, #1e293b 50%, #0f172a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

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

/* Premium Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Content Grid refined */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2.5rem;
    padding: 2rem 0;
}

@media (max-width: 640px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }
}

/* --- Added Styles --- */

/* --- Slider Stage Styles --- */
.slider-container {
    overflow: hidden;
    position: relative;
    height: clamp(400px, 60vh, 750px);
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .slider-container {
        height: clamp(500px, 75vh, 750px);
        margin-bottom: 4rem;
    }
}


.slider-item.active {
    opacity: 1 !important;
    z-index: 10;
}

.slider-item.active .content-box {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.content-box {
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

[dir="rtl"] .content-box {
    text-align: right;
}

[dir="ltr"] .content-box {
    text-align: left;
}

/* --- Search UI Refinement --- */
.search-results-section {
    border-right: 4px solid var(--accent-color);
    padding-right: 1.5rem;
    margin-bottom: 5rem;
}

.search-results-section.tv {
    border-color: #3b82f6;
}

/* --- Professional Typography --- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}