/**
 * Sacnilk - Custom CSS Styles
 * Mobile-first responsive design with performance optimizations
 */

/* CSS Variables for Theming */

:root {
    --color-primary: #1e3a8a;
    --color-secondary: #fbbf24;
    --color-accent: #10b981;
    --color-dark: #111827;
    --color-light: #f9fafb;
    --color-text-primary: #1f2937;
    --color-text-secondary: #6b7280;
    --font-primary: 'Nunito Sans', sans-serif;
    --font-heading: 'Nunito Sans', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-radius: 0.5rem;
    --transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
    :root {
        --color-light: #111827;
        --color-dark: #f9fafb;
        --color-text-primary: #f3f4f6;
        --color-text-secondary: #d1d5db;
    }
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1.125rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-secondary);
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* AdSense Container Styles */
.adsense-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.adsense-container:hover {
    box-shadow: var(--shadow-md);
}

.adsense-container::before {
    content: 'Advertisement';
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 10px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 10px;
    z-index: 10;
}

/* Test Ad Mode Styles */
.ad-test-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    border-radius: var(--border-radius);
}

/* Carousel Styles */
.carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.carousel-container {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
}

.carousel-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
    border-color: var(--color-secondary);
}

.carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 8px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

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

.carousel-dot.active {
    background: var(--color-secondary);
    transform: scale(1.2);
    border-color: white;
}

/* Movie Card Styles */
.movie-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: white;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.movie-card img {
    transition: transform 0.3s ease;
}

.movie-card:hover img {
    transform: scale(1.05);
}

/* Rating Stars */
.rating-stars {
    color: var(--color-secondary);
    font-size: 1.1em;
    font-weight: 600;
}

/* Header Styles */
.header-nav {
    backdrop-filter: blur(20px);
    background: rgba(30, 58, 138, 0.95);
    transition: var(--transition);
}

.header-nav.scrolled {
    box-shadow: var(--shadow-lg);
    background: rgba(30, 58, 138, 0.98);
}

/* Mobile Menu Animation */
.animate-slideDown {
    animation: slideDown 0.3s ease-out;
}

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

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

/* Filter Button Styles */
.filter-btn {
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

/* Sticky Ad Styles */
.sticky-ad {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    transition: var(--transition);
}

.sticky-ad:hover {
    transform: translateY(-50%) scale(1.02);
}

/* Back to Top Button */
#backToTop {
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#backToTop.visible {
    transform: translateY(0);
    opacity: 1;
}

#backToTop:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Footer Styles */
.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-secondary), transparent);
    border-radius: 2px;
}

/* Loading Animation */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

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

/* Form Styles */
input[type="email"],
input[type="search"],
input[type="text"],
textarea {
    appearance: none;
    border-radius: var(--border-radius);
    border: 1px solid #d1d5db;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
}

input[type="email"]:focus,
input[type="search"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

button {
    appearance: none;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 0.75rem;
    }

    .carousel-arrow {
        width: 35px;
        height: 35px;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .sticky-ad {
        display: none;
    }

    .movie-card:hover {
        transform: translateY(-4px);
    }
}

@media (max-width: 480px) {
    .carousel-arrow {
        width: 30px;
        height: 30px;
    }

    .carousel-prev {
        left: 5px;
    }

    .carousel-next {
        right: 5px;
    }
}

/* High DPI Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .adsense-container::before {
        font-size: 9px;
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .carousel-container {
        transition: none;
    }

    .movie-card {
        transition: none;
    }
}

/* Print Styles */
@media print {

    .carousel-arrow,
    .carousel-dots,
    .sticky-ad,
    #backToTop,
    .adsense-container {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    a {
        color: black !important;
        text-decoration: underline !important;
    }
}

/* Performance Optimizations */
.carousel-container,
.movie-card,
.carousel-arrow {
    will-change: transform;
}

/* Focus Management */
.skip-link:focus {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: 1rem;
    text-decoration: none;
    z-index: 9999;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

thead th {
    background: #f8f9fa;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid #dee2e6;
}

tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

tbody tr:hover {
    background: #f8f9fa;
}

/* Newsletter Signup */
.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    min-width: 0;
}

@media (max-width: 640px) {
    .newsletter-form {
        flex-direction: column;
    }
}

/* Advanced Grid Layouts */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.box-office-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

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

/* Error States */
.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* Success States */
.success-message {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* Custom Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: var(--color-primary);
    color: white;
}

.badge-secondary {
    background: var(--color-secondary);
    color: black;
}

.badge-success {
    background: var(--color-accent);
    color: white;
}

/* Progressive Enhancement */
.no-js .carousel-container {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.no-js .carousel-arrow {
    display: none;
}

/* ===== RESPONSIVE LAYOUT WITH AD SPACES ===== */

/* Base Layout Container */
.layout-wrapper {
    display: grid;
    width: 100%;
    min-height: 100vh;
}

/* Mobile First (Default) - No ads, full width content */
.layout-wrapper {
    grid-template-columns: 1fr;
    grid-template-areas: "content";
    gap: 0;
}

.ad-left,
.ad-right {
    display: none;
}

#main-content {
    grid-area: content;
    padding: 1rem !important;
    /* Override existing padding on mobile */
    margin: 0 !important;
}

/* ===== TABLET AND ABOVE (768px+) ===== */
@media (min-width: 768px) {
    .layout-wrapper {
        grid-template-columns: 120px 1fr 120px;
        grid-template-areas: "ad-left content ad-right";
        gap: 1rem;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 1rem;
    }

    .ad-left,
    .ad-right {
        display: block;
        min-height: 400px;
    }

    .ad-left {
        grid-area: ad-left;
    }

    .ad-right {
        grid-area: ad-right;
    }

    #main-content {
        grid-area: content;
        padding: 1.5rem !important;
    }
}

/* ===== DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
    .layout-wrapper {
        grid-template-columns: 160px 1fr 160px;
        gap: 1.5rem;
        max-width: 1400px;
        padding: 0 2rem;
    }

    .ad-left,
    .ad-right {
        min-height: 600px;
    }

    #main-content {
        padding: 2rem !important;
    }
}

/* ===== LARGE DESKTOP (1280px+) ===== */
@media (min-width: 1280px) {
    .layout-wrapper {
        grid-template-columns: 200px 1fr 200px;
        gap: 2rem;
        max-width: 1600px;
    }

    #main-content {
        padding: 2.5rem !important;
    }
}

/* ===== EXTRA LARGE SCREENS (1536px+) ===== */
@media (min-width: 1536px) {
    .layout-wrapper {
        grid-template-columns: 250px 1fr 250px;
        gap: 2.5rem;
        max-width: 1800px;
    }
}

/* ===== AD STYLING ===== */
.ad-container {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: sticky;
    top: 20px;
    transition: all 0.3s ease;
}

.ad-container:hover {
    border-color: #adb5bd;
    background: #e9ecef;
}

/* ===== MOBILE SPECIFIC OVERRIDES ===== */
@media (max-width: 767px) {

    /* Force full width on mobile */
    .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    #main-content {
        padding: 1rem !important;
        margin: 0 !important;
    }

    /* Hide any potential ad containers */
    .ad-left,
    .ad-right,
    .ad-container,
    .advertisement {
        display: none !important;
    }
}

/* ===== SCREEN RESOLUTION DETECTION (Optional) ===== */
.screen-info {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 9999;
    font-family: monospace;
}

/* ===== UTILITY CLASSES FOR DIFFERENT BREAKPOINTS ===== */
@media (max-width: 767px) {
    .mobile-only {
        display: block !important;
    }

    .tablet-up {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }

    .tablet-up {
        display: block !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .tablet-only {
        display: block !important;
    }
}

@media (min-width: 1024px) {
    .desktop-up {
        display: block !important;
    }

    .tablet-only {
        display: none !important;
    }
}
* ===== OTT RELEASES SIDEBAR STYLES ===== */
.ott-releases-sidebar {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ott-releases-sidebar h2 {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.ott-releases-sidebar .movie-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.ott-releases-sidebar .movie-item:last-child {
    border-bottom: none;
}

.ott-releases-sidebar .movie-item:hover {
    background-color: #f9fafb;
    border-radius: 6px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.ott-releases-sidebar .movie-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ott-releases-sidebar .movie-name {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.ott-releases-sidebar .release-date {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.ott-releases-sidebar .platform-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: bold;
    color: #000000;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    border: 1px solid #f59e0b;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.25rem;
}

.ott-releases-sidebar .view-all-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ott-releases-sidebar .view-all-link:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ott-releases-sidebar .no-releases {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 1rem 0;
}

/* Responsive adjustments for OTT releases sidebar */
@media (max-width: 768px) {
    .ott-releases-sidebar {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .ott-releases-sidebar h2 {
        font-size: 1.125rem;
    }
    
    .ott-releases-sidebar .movie-item {
        padding: 0.5rem 0;
    }
    
    .ott-releases-sidebar .platform-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}