/* ROOT VARIABLES (LIGHT MODE LOOK) */
:root {
    --bg-color: #f8f9fa;            
    --section-bg: #ffffff;          
    --card-bg: #ffffff;              
    --text-color: #212529;          
    --text-muted: #6c757d;          
    --nav-bg: rgba(255, 255, 255, 0.7) !important; 
    --nav-text: #212529 !important; 
    --toggle-bg: #ccc;
    --card-shadow: rgba(0, 0, 0, 0.05);
}

/* DARK MODE LOOK (Best for Movie Sites) */
[data-theme="dark"] {
    --bg-color: #121212;            
    --section-bg: #1a1a1a;          
    --card-bg: #22252a;              
    --text-color: #f8f9fa;          
    --text-muted: #a6b0ba;          
    --nav-bg: rgba(26, 26, 26, 0.7) !important; 
    --nav-text: #ffffff !important; 
    --toggle-bg: #ffcc00; 
    --card-shadow: rgba(0, 0, 0, 0.4);
}

/* Base Styles */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-top: 0 !important;
}

html {
    scroll-behavior: smooth;
}

/* Navbar Glassmorphism */
.navbar {
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.4s ease-in-out, backdrop-filter 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
}

.navbar .navbar-brand, .navbar .navbar-nav .nav-link {
    color: var(--nav-text) !important;
    transition: color 0.3s;
}

.navbar .navbar-nav .nav-link {
    opacity: 0.85;
}

.navbar .navbar-nav .nav-link:hover {
    opacity: 1;
    color: #ffcc00 !important; 
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), 
                url('https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?q=80&w=1200') no-repeat center center/cover;
    height: 90vh;
}

/* Dynamic Sections */
.services-section {
    background-color: var(--section-bg);
    transition: background-color 0.3s ease;
}

.section-main-title {
    color: var(--text-color) !important;
    border-left: 5px solid #ffcc00;
}

/* Movie/Trailer Button Custom Styles */
.btn-warning {
    background-color: #ffcc00 !important;
    border-color: #ffcc00 !important;
    color: #000 !important;
}

.btn-warning:hover {
    background-color: #e6b800 !important;
    border-color: #e6b800 !important;
}

.btn-outline-warning {
    color: #ffcc00 !important;
    border-color: #ffcc00 !important;
}

.btn-outline-warning:hover {
    background-color: #ffcc00 !important;
    color: #000 !important;
}

/* Contact Form Dynamic Styles */
#contactForm {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px var(--card-shadow) !important;
    transition: background-color 0.3s ease;
}

#contactForm .form-control {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] #contactForm .form-control {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Theme Toggle Button */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

/* Theme Toggle Button එකේ ප්‍රධාන සැකිල්ල */
.theme-btn {
    background-color: #1a1a1a;
    border-radius: 50px;
    border: 2px solid #ffcc00;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px; /* අයිකන් දෙක දෙපැත්තට ලස්සනට සෙට් වෙන්න padding හැදුවා */
    position: relative;
    height: 30px;
    width: 60px;
    cursor: pointer;
    outline: none;
    transition: background-color 0.3s ease;
}

/* ඇතුලේ තියෙන ඉර/හඳ අයිකන් */
.theme-btn i {
    font-size: 14px;
    color: #ffcc00;
    z-index: 1;
}

/* කහ පාට බෝලේ (Ball) */
.theme-btn .ball {
    background-color: #ffcc00;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    height: 22px;
    width: 22px;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* ලස්සනට පැනලා යන Effect එක */
    z-index: 2;
}

/* ===================================================
   FIXED TOGGLE LOGIC (රාහුල ප්‍රොජෙක්ට් එක වෙනුවෙන් නිවැරදි කළ කොටස)
   ===================================================
*/

/* Dark Mode එකේදී බෝලය වමට (0px) ගොස් ඉර වසා සඳ පෙන්වයි */
[data-theme="dark"] .theme-btn .ball {
    transform: translateX(0px) !important;
}

/* Light Mode එකේදී බෝලය දකුණට (32px) ගොස් සඳ වසා ඉර පෙන්වයි */
[data-theme="light"] .theme-btn .ball {
    transform: translateX(32px) !important; /* බොත්තමේ පළල අනුව නූලටම සෙට් කර ඇත */
    background-color: #ff9800;
}

/* Premium Hamburger Menu Button */
.premium-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    padding: 0;
    z-index: 1050;
}

.premium-hamburger span {
    display: block;
    width: 100%;
    height: 3.5px;
    background-color: #ffcc00;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Premium Sidebar Menu */
.premium-sidebar {
    background: rgba(10, 10, 10, 0.95) !important;
    backdrop-filter: blur(10px);
    width: 320px !important;
    border-right: 1px solid rgba(255, 204, 0, 0.1);
}

.custom-close-btn {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.6;
    transition: 0.3s;
}

.custom-close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.premium-link {
    color: #a0a0a0 !important;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 18px !important;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.4s ease;
    text-decoration: none;
}

.premium-link i {
    width: 30px;
    font-size: 18px;
    color: #555;
}

.premium-link:hover {
    background: linear-gradient(90deg, rgba(255, 204, 0, 0.1) 0%, transparent 100%);
    color: #ffffff !important;
    transform: translateX(8px);
}

.premium-link.active {
    background: rgba(255, 204, 0, 0.15);
    color: #ffcc00 !important;
    border-left: 4px solid #ffcc00;
}

/* Navbar Scroll Effect */
.navbar.scrolled {
    background-color: rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(25px) saturate(200%) !important;
}

/* =========================================
    MOVIE CARD STYLES
========================================= */
.movie-card {
    position: relative;
    display: block;
    height: 320px;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    background-color: #111;
    z-index: 1;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(255, 204, 0, 0.3);
}

.movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.year-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ffcc00;
    color: #000;
    font-weight: 900;
    padding: 5px 15px;
    border-bottom-left-radius: 8px;
    font-size: 13px;
    z-index: 2;
}

.sub-badge {
    position: absolute;
    top: 95px; /* අකුරු දිග නිසා ටිකක් පහළට කළා */
    left: -48px; /* අකුරු දිග නිසා ටිකක් වමට කළා */
    background-color: #ffcc00;
    color: #000;
    font-weight: 900;
    padding: 4px 15px;
    font-size: 11px;
    transform: rotate(-90deg);
    z-index: 2;
    letter-spacing: 1px;
}

.movie-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 60px 10px 15px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 40%, rgba(0,0,0,0) 100%);
    text-align: center;
    z-index: 2;
}

.movie-card-wrapper {
    position: relative;
    transition: transform 0.3s ease;
}

.movie-title {
    color: #fff;
    font-size: 15px;
    margin: 0;
    font-weight: bold;
    text-transform: uppercase;
}

/* =========================================
    ADMIN SYSTEM STYLES
========================================= */
#adminLoginModal .modal-content,
#adminDashboardModal .modal-content {
    box-shadow: 0 10px 30px rgba(255, 204, 0, 0.15);
    border-radius: 12px;
}

#adminLoginModal .form-control:focus,
#adminDashboardModal .form-control:focus {
    border-color: #ffcc00 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 204, 0, 0.25) !important;
    background-color: #1f1f1f !important;
}

#loginError {
    font-size: 14px;
    font-weight: 600;
    animation: shakeError 0.3s ease-in-out;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

#addTrailerForm .form-label {
    letter-spacing: 0.5px;
    font-size: 14px;
    color: #e0e0e0;
}

/* ===================================================
   ROBUST DYNAMIC DELETE BUTTON SYSTEM (NEWLY INTEGRATED)
=================================================== */
.delete-btn {
    display: none !important; /* සාමාන්‍ය පරිශීලකයින්ට සම්පූර්ණයෙන්ම සඟවයි */
    transition: all 0.3s ease !important;
    background-color: #dc3545 !important;
    border: none !important;
    cursor: pointer;
    opacity: 0.9;
}

/* Body එකට admin-mode ක්ලාස් එක වැටුණු සැනින් සියලුම පරණ හා අලුත් කාඩ් වල බොත්තම පෙන්වයි */
body.admin-mode .delete-btn {
    display: block !important; 
}

.delete-btn:hover {
    background-color: #a71d2a !important;
    transform: scale(1.1) !important;
    opacity: 1 !important;
}/* =========================================
   CATEGORY FILTER STYLES (NEW)
========================================= */
.category-filters-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    /* Hide scrollbar for clean look */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.category-filters-container::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid rgba(255, 204, 0, 0.3);
    padding: 6px 18px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: rgba(255, 204, 0, 0.1);
    border-color: #ffcc00;
}

.filter-btn.active {
    background-color: #ffcc00;
    color: #000;
    border-color: #ffcc00;
    box-shadow: 0 4px 10px rgba(255, 204, 0, 0.3);
}

/* Category Badge on Movie Card */
.category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffcc00;
    border: 1px solid #ffcc00;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 2;
    text-transform: uppercase;
}/* ===================================================
   PREMIUM PRELOADER SYSTEM (FOR RAHULA WEB TEAM PROJECT)
=================================================== */
#custom-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #0c0c0c; /* වීඩියෝ එකේ වගේම සිනමාටික් තද කළු පැහැය */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; /* වෙබ් එකේ වෙන හැමදේකටම වඩා උඩින් තබා ගැනීමට */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.6s;
}

/* තත්පර 3කට පසු සුමටව අතුරුදන් වීමට */
#custom-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
}

/* රන්වන් පැහැති කැරකෙන චක්‍රය (Premium Golden Spinner) */
.premium-spinner {
    width: 65px;
    height: 65px;
    border: 4px solid rgba(255, 204, 0, 0.1);
    border-top: 4px solid #ffcc00; /* ඔයාගේ වෙබ් එකේ තීම් පාට (Gold) */
    border-radius: 50%;
    margin: 0 auto 25px auto;
    animation: spinSmooth 1s linear infinite;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.2);
}

/* මැද තියෙන අකුරු වල ස්ටයිල් එක */
.preloader-logo {
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0;
    text-transform: uppercase;
    animation: pulseText 2s ease-in-out infinite;
}

.preloader-logo .accent-text {
    color: #ffcc00; /* LK කෑල්ල රන්වන් පාටින් පෙන්වීමට */
}

/* ඇනිමේෂන් ක්‍රියාත්මක වන ආකාරය (Keyframes) */
@keyframes spinSmooth {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseText {
    0%, 100% { opacity: 0.8; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
}/* ========================================= */
/* PREMIUM SEARCH BAR STYLES                 */
/* ========================================= */
#movieSearchBox {
    width: 100%;
    padding: 14px 25px;
    font-size: 16px;
    background-color: #000000 !important; /* ඇතුළ කළු */
    color: #ffffff !important;            /* අකුරු සුදු */
    border: 2px solid #ffffff;            /* වටේට සුදු රාමුව */
    border-radius: 30px;
    outline: none;
    transition: 0.3s ease-in-out;
}
#movieSearchBox::placeholder {
    color: #bbbbbb;
}
#movieSearchBox:focus {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

/* Search Suggestions Box (පින්තූරය සහ නම පෙන්වන තීරුව) */
.search-suggestions-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background-color: #111111;
    border: 1px solid #ffffff;
    border-radius: 12px;
    max-height: 320px;
    overflow-y: auto;
    display: none; /* මුලින් හැංගිලා තියෙන්නේ */
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.9);
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #333333;
    cursor: pointer;
    text-decoration: none;
    color: #ffffff;
    transition: background 0.2s;
}
.search-suggestion-item:last-child {
    border-bottom: none;
}
.search-suggestion-item:hover {
    background-color: #2a2a2a;
    color: #ffc107; /* කහ පාට (Hover වෙද්දි) */
}
.search-suggestion-item img {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
}
.search-suggestion-item span {
    font-size: 16px;
    font-weight: bold;
}