/* =================================================================
        * 1. THEME & CORE STYLES
        * ================================================================= */
:root {
    /* Default Theme: Cinematic Dark */
    --bg-color: #121212;
    --bg-secondary-color: #1c1c1c;
    --text-color: #e0e0e0;
    --text-muted-color: #aaa;
    --border-color: #282828;
    --primary-color: #0d6efd;
    --primary-hover-color: #0b5ed7;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    --navbar-bg: rgba(18, 18, 18, 0.85);
    --modal-bg: rgba(20, 20, 22, 0.75);
    --modal-border: 1px solid rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-border: 1px solid rgba(255, 255, 255, 0.2);
    --input-focus-border: rgba(13, 110, 253, 0.7);
    --input-focus-shadow: 0 0 15px rgba(13, 110, 253, 0.5);
    --btn-close-filter: invert(1);
    /* -- NEW DROPDOWN COLORS -- */
    --dropdown-bg-color: #1c1c1c;
    --dropdown-border-color: #282828;
    --checkbox-bg-color: #444;
    --checkbox-border-color: #666;
    /* -- NEW CLICK SHADOW -- */
    --clicked-shadow: 0 0 15px color-mix(in srgb, var(--primary-color) 60%, transparent);
}

[data-theme="skyblue"] {
    --bg-color: #0f172a;
    --bg-secondary-color: #1e293b;
    --text-color: #f1f5f9;
    --text-muted-color: #94a3b8;
    --border-color: #334155;
    --primary-color: #38bdf8;
    --primary-hover-color: #0ea5e9;
    --card-shadow: 0 8px 25px rgba(56, 189, 248, 0.2);
    --navbar-bg: rgba(15, 23, 42, 0.85);
    --modal-bg: rgba(15, 23, 42, 0.85);
    --modal-border: 1px solid var(--border-color);
    --input-bg: rgba(56, 189, 248, 0.05);
    --input-border: 1px solid var(--border-color);
    --input-focus-border: var(--primary-color);
    --input-focus-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
    --btn-close-filter: invert(1);
    --dropdown-bg-color: #1e293b;
    --dropdown-border-color: #334155;
    --checkbox-bg-color: rgba(56, 189, 248, 0.08);
    --checkbox-border-color: #334155;
    --clicked-shadow: 0 0 15px color-mix(in srgb, var(--primary-color) 60%, transparent);
}

[data-theme="emerald"] {
    --bg-color: #0E2421;
    --bg-secondary-color: #1A3A34;
    --text-color: #E8EBE5;
    --text-muted-color: #92A39D;
    --border-color: #2F5D53;
    --primary-color: #D4AF37;
    --primary-hover-color: #EAC450;
    --card-shadow: 0 8px 25px rgba(212, 175, 55, 0.15);
    --navbar-bg: rgba(14, 36, 33, 0.85);
    --modal-bg: rgba(14, 36, 33, 0.8);
    --input-bg: rgba(212, 175, 55, 0.05);
    --input-border: 1px solid var(--border-color);
    --input-focus-border: var(--primary-color);
    --input-focus-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    --dropdown-bg-color: #1A3A34;
    --dropdown-border-color: #2F5D53;
    --checkbox-bg-color: rgba(212, 175, 55, 0.08);
    --checkbox-border-color: #2F5D53;
    --clicked-shadow: 0 0 15px color-mix(in srgb, var(--primary-color) 60%, transparent);
}

[data-theme="midnight"] {
    --bg-color: #1D2A3C;
    --bg-secondary-color: #2C3E50;
    --text-color: #ECF0F1;
    --text-muted-color: #95A5A6;
    --border-color: #34495E;
    --primary-color: #E67E22;
    --primary-hover-color: #F39C12;
    --card-shadow: 0 8px 25px rgba(230, 126, 34, 0.2);
    --navbar-bg: rgba(29, 42, 60, 0.85);
    --modal-bg: rgba(29, 42, 60, 0.8);
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-border: 1px solid var(--border-color);
    --input-focus-border: var(--primary-color);
    --input-focus-shadow: 0 0 15px rgba(230, 126, 34, 0.5);
    --dropdown-bg-color: #2C3E50;
    --dropdown-border-color: #34495E;
    --checkbox-bg-color: rgba(0, 0, 0, 0.3);
    --checkbox-border-color: #34495E;
    --clicked-shadow: 0 0 15px color-mix(in srgb, var(--primary-color) 60%, transparent);
}

[data-theme="cosmic"] {
    --bg-color: #36013F;
    --bg-secondary-color: #321A43;
    --text-color: #d3b8e0;
    --text-muted-color: #9ea0e0;
    --border-color: #4F3A6A;
    --primary-color: #7b7bc1;
    --primary-hover-color: #9ea0e0;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    --navbar-bg: rgba(54, 1, 63, 0.85);
    --modal-bg: rgba(50, 26, 67, 0.8);
    --modal-border: 1px solid var(--border-color);
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-border: 1px solid var(--border-color);
    --input-focus-border: var(--primary-color);
    --input-focus-shadow: 0 0 15px rgba(123, 123, 193, 0.5);
    --btn-close-filter: invert(1);
    --dropdown-bg-color: #321A43;
    --dropdown-border-color: #4F3A6A;
    --checkbox-bg-color: rgba(0, 0, 0, 0.3);
    --checkbox-border-color: #4F3A6A;
    --clicked-shadow: 0 0 15px color-mix(in srgb, var(--primary-color) 60%, transparent);
}

[data-theme="pink"] {
    --bg-color: #2E0219;
    --bg-secondary-color: #4A0429;
    --text-color: #FAE1F0;
    --text-muted-color: #D4A5C2;
    --border-color: #8C1C50;
    --primary-color: #FF69B4;
    --primary-hover-color: #FF1493;
    --card-shadow: 0 8px 25px rgba(255, 105, 180, 0.25);
    --navbar-bg: rgba(46, 2, 25, 0.9);
    --modal-bg: rgba(46, 2, 25, 0.85);
    --modal-border: 1px solid var(--border-color);
    --input-bg: rgba(255, 105, 180, 0.05);
    --input-border: 1px solid var(--border-color);
    --input-focus-border: var(--primary-color);
    --input-focus-shadow: 0 0 15px rgba(255, 105, 180, 0.5);
    --btn-close-filter: invert(1);
    --dropdown-bg-color: #4A0429;
    --dropdown-border-color: #8C1C50;
    --checkbox-bg-color: rgba(255, 105, 180, 0.1);
    --checkbox-border-color: #8C1C50;
    --clicked-shadow: 0 0 15px color-mix(in srgb, var(--primary-color) 60%, transparent);
}

[data-theme="ramadan"] {
    --bg-color: #051024;
    --bg-secondary-color: #0a192f;
    --text-color: #f0f4f8;
    --text-muted-color: #94a3b8;
    --border-color: #1e293b;
    --primary-color: #FFD700;
    --primary-hover-color: #FFC107;
    --card-shadow: 0 8px 25px rgba(255, 215, 0, 0.15);
    --navbar-bg: rgba(5, 16, 36, 0.9);
    --modal-bg: rgba(5, 16, 36, 0.85);
    --modal-border: 1px solid var(--border-color);
    --input-bg: rgba(255, 215, 0, 0.05);
    --input-border: 1px solid var(--border-color);
    --input-focus-border: var(--primary-color);
    --input-focus-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    --btn-close-filter: invert(1);
    --dropdown-bg-color: #0a192f;
    --dropdown-border-color: #1e293b;
    --checkbox-bg-color: rgba(255, 215, 0, 0.1);
    --checkbox-border-color: #1e293b;
    --clicked-shadow: 0 0 15px color-mix(in srgb, var(--primary-color) 60%, transparent);
}

/* =================================================================
 * RAMADAN THEME DECORATIONS
 * ================================================================= */

/* Hanging Fanoos Decoration */
.ramadan-decoration {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    z-index: 1000;
    pointer-events: none;
    transform-origin: top center;
    animation: swing 3s ease-in-out infinite alternate;
}

[data-theme="ramadan"] .ramadan-decoration {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ramadan-decoration .wire {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.6), rgba(255,215,0,0.4));
}

.ramadan-decoration .bulb {
    width: 14px;
    height: 18px;
    background: radial-gradient(circle, #fff7cc, #FFD700);
    border-radius: 50%;
    margin: 2px 0;
    box-shadow: 0 0 8px #FFD700, 0 0 16px rgba(255,215,0,0.5);
}

.ramadan-decoration .fanoos-icon {
    font-size: 30px;
    color: #FFD700;
    filter: drop-shadow(0 0 12px rgba(255,215,0,0.9));
    margin-top: 2px;
}

/* Per-element offsets */
.navbar-brand .ramadan-decoration {
    left: 50%;
    animation-delay: 0s;
}

.search-container .ramadan-decoration {
    left: auto;
    right: 5px;
    transform: none;
    animation-delay: 0.8s;
    animation-name: swing-right;
}

.user-dropdown .ramadan-decoration,
div[style*="position: relative"] .ramadan-decoration {
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 1.6s;
}

@keyframes swing {
    0%   { transform: translateX(-50%) rotate(4deg); }
    100% { transform: translateX(-50%) rotate(-4deg); }
}

@keyframes swing-right {
    0%   { transform: rotate(4deg); }
    100% { transform: rotate(-4deg); }
}

/* Light Bubble (Shared Style) */
.light-bubble {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: radial-gradient(circle, #fff7cc, #FFD700);
    border-radius: 50%;
    box-shadow: 0 0 6px #FFD700, 0 0 14px rgba(255,215,0,0.5);
    animation: bubble-glow 2s ease-in-out infinite alternate;
}

.light-bubble:nth-child(odd)  { animation-delay: 0.5s; }
.light-bubble:nth-child(3n)   { animation-delay: 1s; }

@keyframes bubble-glow {
    0%   { box-shadow: 0 0 4px #FFD700, 0 0 8px rgba(255,215,0,0.3); opacity: 0.7; }
    100% { box-shadow: 0 0 8px #FFD700, 0 0 20px rgba(255,215,0,0.7); opacity: 1; }
}

/* Navbar Bottom Light String */
.navbar-bottom-lights {
    display: none;
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    align-items: center;
    pointer-events: none;
    overflow: hidden;
}

[data-theme="ramadan"] .navbar-bottom-lights {
    display: flex;
}

.light-wire {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(255,255,255,0.15), rgba(255,215,0,0.3), rgba(255,255,255,0.15));
    min-width: 4px;
}

/* Ramadan Search Bubbles */
.ramadan-search-wrap { display: none; }
[data-theme="ramadan"] .ramadan-search-wrap { display: block; }

.search-bubbles-top,
.search-bubbles-bottom {
    display: flex;
    justify-content: space-around;
    padding: 3px 8px;
}

/* Fanoos Rain */
.fanoos-rain {
    position: fixed;
    top: -100px;
    z-index: 9999;
    pointer-events: none;
    animation: drop-fall linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

@keyframes drop-fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(110vh) rotate(10deg); opacity: 0; }
}

/* Ramadan-specific rain drop golden glow */
.rain-drop.fanoos-drop {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

/* Add this new class to your CSS */
.element-clicked {
    box-shadow: var(--clicked-shadow);
    transition: box-shadow 0.3s ease-in-out;
}

/* 
   بۆ ئەوەی دوگمە سەرەکییەکان (Call to Action) ڕەنگە پەمەییەکەیان هەبێت
   کە پێشنیارت کردبوو، ئەم یاسا زیادەیە بەکاردەهێنین.
*/
[data-theme="cosmic"] .btn-primary,
[data-theme="cosmic"] .btn-watch-now {
    background-color: #f2a1c4;
    /* ڕەنگی پەمەیی کاڵ (Illusion) */
    border-color: #f2a1c4;
    color: #36013F;
    /* نووسینی تۆخ بۆ خوێندنەوەی ئاسان */
}

[data-theme="cosmic"] .btn-primary:hover,
[data-theme="cosmic"] .btn-watch-now:hover {
    background-color: #e88cb4;
    /* کەمێک تۆختر بۆ hover */
    border-color: #e88cb4;
    color: #36013F;
}




body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}



.navbar {
    background-color: var(--navbar-bg) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar .nav-link,
.navbar .navbar-brand,
.navbar .fa-user-circle {
    color: var(--text-color) !important;
}

.navbar .dropdown-menu {
    background-color: var(--dropdown-bg-color);
    /* CHANGE THIS LINE */
    border: 1px solid var(--dropdown-border-color);
    /* CHANGE THIS LINE & add '1px solid' */
    --bs-dropdown-link-color: var(--text-muted-color);
    /* Optional: Good practice for Bootstrap 5 */
    --bs-dropdown-link-hover-color: #fff;
    /* Optional: Good practice for Bootstrap 5 */
    box-shadow: var(--card-shadow);

}

.navbar .dropdown-item {
    color: var(--text-muted-color);
}

.navbar .dropdown-item:hover {
    background-color: var(--primary-color);
    color: #fff;
}

footer {
    background-color: var(--bg-secondary-color);
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

footer .slogan,
footer .social-icons a {
    color: var(--text-muted-color);
    transition: color 0.2s ease;
}

footer .social-icons a:hover {
    color: var(--primary-color);
}

footer .text-primary {
    color: var(--primary-color) !important;
}

#liveSearchInput {
    background-color: var(--input-bg);
    border: var(--input-border);
    color: var(--text-color);
}

#liveSearchInput::placeholder {
    color: var(--text-muted-color);
    opacity: 1;
}

.live-search-results {
    display: none;
    position: absolute;
    top: 140%;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: 1000px; /* Massive width for cinematic feel */
    min-height: 300px;
    max-height: 700px;
    overflow-y: auto;
    background-color: rgba(14, 20, 27, 0.95);
    backdrop-filter: blur(30px); /* Heavy blur */
    -webkit-backdrop-filter: blur(30px);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    padding: 1.5rem;
    z-index: 1000;
}

/* Custom Scrollbar */
.live-search-results::-webkit-scrollbar {
    width: 8px;
}
.live-search-results::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.live-search-results::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
.live-search-results::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Bigger cards */
    gap: 1.5rem;
    padding: 0.5rem;
}

.result-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    animation: cardEntry 0.4s ease-out backwards;
}

@keyframes cardEntry {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stagger animations for first few items (heuristic) */
.result-card:nth-child(1) { animation-delay: 0.05s; }
.result-card:nth-child(2) { animation-delay: 0.1s; }
.result-card:nth-child(3) { animation-delay: 0.15s; }
.result-card:nth-child(4) { animation-delay: 0.2s; }
.result-card:nth-child(5) { animation-delay: 0.25s; }
.result-card:nth-child(6) { animation-delay: 0.3s; }

.result-card:hover {
    transform: translateY(-8px) scale(1.02);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 5;
}

.result-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 0; /* Full bleed top */
    box-shadow: none;
    margin-bottom: 0;
    transition: transform 0.5s ease;
}

.result-card:hover img {
    transform: scale(1.05); /* Subtle zoom */
}

.result-card-info {
    text-align: center;
    padding: 1rem 0.5rem;
    position: relative;
    z-index: 2;
}

.result-card-title {
    font-size: 0.95rem; /* Larger Title */
    font-weight: 700;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.result-card-genre {
    font-size: 0.7rem;
    color: var(--text-muted-color);
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Suggested Card Small Update for new width */
.suggested-card-sm {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 120px; /* Taller */
    display: block;
}

.suggested-card-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.live-search-results .results-header {
    grid-column: 1 / -1; /* Header takes full width */
    margin-top: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#loginModal .modal-content {
    background: var(--modal-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--modal-border);
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    color: var(--text-color);
}

#loginModal .modal-body {
    padding: 0;
    height: 550px;
}

.form-icon-container {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 3.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 20px color-mix(in srgb, var(--primary-color) 40%, transparent);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.form-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.form-panel {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}

.form-panel.signup-panel {
    transform: translateX(100%);
}

.form-container.show-signup .login-panel {
    transform: translateX(-100%);
}

.form-container.show-signup .signup-panel {
    transform: translateX(0);
}

.form-side {
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.character-panel {
    position: relative;
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    height: 100%;
}

.character-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4));
}

.character-panel .content {
    position: relative;
    z-index: 2;
}

.character-panel h1 {
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.character-panel p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.btn-switch {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
    font-weight: bold;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}

.btn-switch:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.theme-switcher .dropdown-toggle::after {
    display: none;
}

.theme-switcher .dropdown-menu {
    min-width: 0;
    padding: 0.5rem;
}

.theme-switcher .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 5px;
}

.theme-switcher .dropdown-item.active i {
    color: var(--primary-color);
}

.modal-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px color-mix(in srgb, var(--primary-color) 50%, transparent);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover-color);
    border-color: var(--primary-hover-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--primary-color) 30%, transparent);
}

.contact-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.contact-link:hover {
    color: var(--primary-color);
}

.btn-copy {
    background-color: transparent;
    border: none;
    color: var(--text-muted-color);
    padding: 0.2rem 0.5rem;
    transition: color 0.2s ease;
}

.btn-copy:hover {
    color: var(--primary-color);
}

.navbar-toggler {
    border: none;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler .navbar-toggler-icon {
    background-image: none;
    height: 2px;
    background-color: var(--text-color);
    display: block;
    position: relative;
    transition: background-color 0.2s ease-out;
}

.navbar-toggler .navbar-toggler-icon::before,
.navbar-toggler .navbar-toggler-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}

.navbar-toggler .navbar-toggler-icon::before {
    top: -8px;
}

.navbar-toggler .navbar-toggler-icon::after {
    top: 8px;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-color: transparent;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
    transform: translateY(8px) rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
    transform: translateY(-8px) rotate(-45deg);
}

.mobile-top-nav {
    background-color: var(--navbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand-logo {
    width: 100px;
    height: auto;
}

@media (min-width: 992px) {
    .navbar-brand-logo {
        width: 130px;
    }
}

.mobile-nav-action-icon {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-nav-action-icon:hover {
    color: var(--primary-color);
}

/* Cinematic Mobile Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(14, 20, 27, 0.95); /* Deep dark base */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1056;
    display: flex;
    flex-direction: column;
    padding: 0;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-overlay.active {
    transform: translateY(0);
}

.search-overlay-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.search-overlay-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), transparent);
}

.search-overlay .back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-overlay .back-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.2);
}

.search-overlay .input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-overlay .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted-color);
    pointer-events: none;
}

.search-overlay #liveSearchInputMobile {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border-radius: 50px;
    padding: 0.7rem 2.5rem 0.7rem 1rem; /* Right padding for icon */
    font-size: 1rem;
    box-shadow: none;
    transition: all 0.3s ease;
}

.search-overlay #liveSearchInputMobile:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.search-overlay #liveSearchInputMobile::placeholder {
    color: var(--text-muted-color);
    opacity: 0.7;
}

/* Default State (Trending) Styles */
#mobileSearchDefaultState {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.section-title {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge-trend {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.badge-trend:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.suggested-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.suggested-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.suggested-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.suggested-card span {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Results Styles */
.search-overlay-results {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.results-header {
    font-size: 0.85rem;
    color: var(--text-muted-color);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin: 1rem 0 0.5rem 0;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.results-header:first-child {
    margin-top: 0;
}

.search-overlay-results .result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
    background: transparent;
}

.search-overlay-results .result-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: scale(0.99);
}

/* Animation Utilities */
.fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Live Search Desktop Adjustment (Consolidating styles) */
.live-search-results .result-item img,
.search-overlay-results .result-item img {
    width: 45px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    margin-left: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.live-search-results .result-item img.staff-avatar,
.search-overlay-results .result-item img.staff-avatar {
    height: 45px;
    border-radius: 50%;
}

.result-details {
    flex-grow: 1;
    min-width: 0; /* Prevent flex text overflow */
}

.result-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-genre {
    font-size: 0.75rem;
    color: var(--text-muted-color);
    margin-bottom: 0;
}

.result-type {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    margin-top: 0;
    float: left; /* Align to the left (Persian/Kurdish context) */
}

.result-type.movie { background-color: #e74c3c; }
.result-type.tv { background-color: #f1c40f; color: #000; }
.result-type.staff { background-color: #3498db; }


@media (max-width: 767.98px) {
    #loginModal .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }

    #loginModal .modal-body,
    #loginModal .form-container {
        height: 75vh;
        min-height: 480px;
    }

    .character-panel {
        flex: 0 0 40%;
        max-width: 40%;
        padding: 1rem 0.5rem;
        justify-content: flex-end;
    }

    .form-side {
        flex: 0 0 60%;
        max-width: 60%;
        padding: 1.25rem 1rem;
        justify-content: center;
    }

    .character-panel .content h1 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .character-panel .content p {
        font-size: 0.75rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }

    .character-panel .btn-switch {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    .form-icon-container {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .form-side h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .form-control-cinematic,
    .form-control-cinematic::placeholder {
        font-size: 0.8rem;
    }

    .input-group-text {
        padding: 0.375rem 0.6rem;
    }

    .form-side a.small {
        font-size: 0.7rem;
    }

    .form-side .input-group {
        margin-bottom: 0.75rem !important;
    }

    .form-side .d-flex.justify-content-end {
        margin-bottom: 1rem !important;
    }
}

.modal .btn-close {
    color: var(--primary-color);
    background-color: rgba(201, 220, 244, 1);
    opacity: 0.7;
    transition: all 0.2s ease-in-out;
}

.modal .btn-close:hover {
    color: var(--primary-color);
    opacity: 1;
    transform: scale(1.5);
}

.modal .btn-close:focus {
    box-shadow: none;
    color: var(--primary-color);
    opacity: 1;
}

.offcanvas .theme-dropdown-mobile .dropdown-toggle {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    text-align: right;
}

.offcanvas .theme-dropdown-mobile .dropdown-toggle:hover {
    background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
}

.offcanvas .theme-dropdown-mobile .dropdown-menu {
    background-color: var(--bg-secondary-color);
    border-color: var(--border-color);
}

.offcanvas .theme-dropdown-mobile .dropdown-item {
    color: var(--text-muted-color);
    padding: 0.75rem 1rem;
}

.offcanvas .theme-dropdown-mobile .dropdown-item:hover,
.offcanvas .theme-dropdown-mobile .dropdown-item.active {
    background-color: var(--primary-color);
    color: #fff;
}

#mobileOffcanvas {
    background-color: var(--bg-secondary-color);
    color: var(--text-color);
    border-left: 1px solid var(--border-color);
}

#mobileOffcanvas .offcanvas-header {
    background-color: var(--bg-secondary-color);
    border-bottom: 1px solid var(--border-color);
}

/* Add this to your existing CSS file */
.navbar .nav-link.active,
.offcanvas .nav-link.active {
    background-color: var(--primary-color);
    color: #fff !important;
    border-radius: 5px;
}

/* Styles for Dropdowns inside the Mobile Offcanvas Menu */
.offcanvas .dropdown-menu {
    background-color: var(--dropdown-bg-color);
    border: 1px solid var(--dropdown-border-color);
    box-shadow: var(--card-shadow);

}

.offcanvas .dropdown-item {
    color: var(--text-muted-color);
}

.offcanvas .dropdown-item:hover,
.offcanvas .dropdown-item:focus {
    background-color: var(--primary-color);
    color: #fff;
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.user-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.user-dropdown-toggle i {
    color: #fff;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.user-dropdown-toggle.active i {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 250px;
    background-color: var(--bg-secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Header */
.user-dropdown-menu .dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

.user-dropdown-menu .dropdown-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.user-dropdown-menu .dropdown-header h5 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.user-dropdown-menu .dropdown-header span {
    font-size: 0.85rem;
    color: var(--text-muted-color);
}

/* Dropdown Divider */
.user-dropdown-menu .dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

/* Dropdown Items */
.user-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.user-dropdown-menu .dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
}

.user-dropdown-menu .dropdown-item i {
    width: 20px;
    text-align: center;
}

.user-dropdown-menu .dropdown-item.logout {
    color: #dc3545;
}

.user-dropdown-menu .dropdown-item.logout:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* =================================================================
   * THEME RAIN ANIMATION
   * ================================================================= */
#theme-rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.rain-drop {
    position: absolute;
    top: -50px;
    color: var(--primary-color);
    filter: drop-shadow(0 0 5px var(--primary-color));
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/* Cherry Blossom special animation for Pink theme */
.rain-drop.cherry-blossom {
    animation: fall-sway linear infinite;
    filter: drop-shadow(0 0 8px rgba(255, 182, 193, 0.6));
}

@keyframes fall-sway {
    0% {
        transform: translateY(-50px) translateX(0) rotate(var(--rotation, 0deg));
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    25% {
        transform: translateY(25vh) translateX(-20px) rotate(calc(var(--rotation, 0deg) + 90deg));
    }
    50% {
        transform: translateY(50vh) translateX(20px) rotate(calc(var(--rotation, 0deg) + 180deg));
    }
    75% {
        transform: translateY(75vh) translateX(-10px) rotate(calc(var(--rotation, 0deg) + 270deg));
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(110vh) translateX(15px) rotate(calc(var(--rotation, 0deg) + 360deg));
        opacity: 0;
    }
}
/* =================================================================
 * LOGO BACKLIGHT ANIMATION
 * ================================================================= */
.navbar-brand-logo {
    animation: logo-backlight 3s infinite alternate;
}

@keyframes logo-backlight {
    0% {
        filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.2));
    }
    100% {
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.8));
    }
}
