/* ============================================
   1. VARIABLES & THEMES (PREMIUM GLASSMORPHISM)
   ============================================ */
:root {
    --primary-color: #e50914;
    --primary-hover: #ff0a16;

    /* Dark Mode Variables (Default) */
    --bg-base: #050505;
    --text-color: #ffffff;
    --text-secondary: #aaaaaa;

    /* Glass Panels */
    --glass-bg: rgba(15, 15, 20, 0.4);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-border-light: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.5);

    /* Search Box */
    --search-bg: rgba(0, 0, 0, 0.6);
    --search-border: rgba(255, 255, 255, 0.1);
    --search-shadow-inner: inset 0 2px 10px rgba(0, 0, 0, 0.8);

    /* Ambient Glow */
    --glow-1: rgba(229, 9, 20, 0.08);
    --glow-2: rgba(178, 7, 16, 0.06);
}

body.light-mode {
    --bg-base: #f5f5f7;
    --text-color: #111111;
    --text-secondary: #555555;

    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-border-light: rgba(0, 0, 0, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.05);

    --search-bg: rgba(255, 255, 255, 0.8);
    --search-border: rgba(0, 0, 0, 0.1);
    --search-shadow-inner: inset 0 2px 5px rgba(0, 0, 0, 0.05);

    --glow-1: rgba(229, 9, 20, 0.04);
    --glow-2: rgba(178, 7, 16, 0.03);
}

/* ============================================
   2. GLOBAL STYLES & ANIMATED BACKGROUND
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Noise Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

/* Ambient Animated Glow */
body::after {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200vw;
    height: 200vh;
    background:
        radial-gradient(circle at 20% 30%, var(--glow-1) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, var(--glow-2) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
    animation: slowDrift 20s ease-in-out infinite alternate;
    transition: background 0.4s ease;
}

@keyframes slowDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

/* ============================================
   3. NAVIGATION BAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border-light);
    z-index: 2000;
    box-shadow: 0 4px 30px var(--glass-shadow);
    transition: all 0.4s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(229, 9, 20, 0.6);
}

.logo-icon {
    font-size: 2rem;
    animation: rotate 3s ease-in-out infinite;
}

.logo-text {
    letter-spacing: 2px;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 8px 15px;
    border-radius: 8px;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(229, 9, 20, 0.1);
}

/* ============================================
   4. HERO SECTION & STATS CARDS
   ============================================ */
.hero-section {
    min-height: 80vh;
    /* 🔥 تعديل الـ VPN: سحب الصورة من ملفات الموقع بدل Unsplash المحجوب 🔥 */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(26, 0, 0, 0.9) 100%),
        url('./bg.jpg') center/cover;
    background-blend-mode: overlay;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    margin-top: 70px;
    overflow: hidden;
    padding: 60px 20px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    animation: fadeInUp 1.2s ease;
    width: 100%;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary-color);
    text-shadow: 0 0 40px rgba(229, 9, 20, 0.8), 0 5px 20px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    letter-spacing: 3px;
}

body.light-mode .hero-title {
    text-shadow: 0 2px 10px rgba(229, 9, 20, 0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #f5f5f5;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 40px;
    font-weight: 400;
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 50px;
    margin-bottom: 80px;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
    width: 100%;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    min-width: 180px;
    transition: 0.4s;
    box-shadow: 0 10px 30px var(--glass-shadow);
    margin: 0 15px;
}

.stat-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(229, 9, 20, 0.3);
    border-color: rgba(229, 9, 20, 0.5);
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
}

.stat-label {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 700;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #f5f5f5;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.9);
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 10;
}

.scroll-arrow {
    font-size: 2rem;
    color: var(--primary-color);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) translateX(-50%); }
    50% { transform: translateY(-15px) translateX(-50%); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   5. CONTAINER & QUICK ACTIONS
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.quick-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 50px 0;
    flex-wrap: wrap;
    animation: fadeIn 1.5s ease;
    position: relative;
    z-index: 20;
}

.quick-btn {
    padding: 16px 32px;
    background: rgba(229, 9, 20, 0.1);
    border: 2px solid var(--primary-color);
    color: var(--text-color);
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-btn:hover {
    background: var(--primary-color);
    color: #ffffff !important;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   6. PREMIUM GLASS SECTIONS (Search, Form, Cards)
   ============================================ */
.add-movie-section,
.add-form-container,
.movie-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border) !important;
    border-top: 1px solid var(--glass-border-light) !important;
    border-left: 1px solid var(--glass-border-light) !important;
    border-radius: 30px;
    box-shadow: 0 15px 35px var(--glass-shadow);
    transition: all 0.4s ease;
    position: relative;
}

.add-movie-section {
    padding: 50px 40px;
    margin-bottom: 60px;
}

.add-form-container {
    padding: 40px;
    max-width: 900px;
    margin: 40px auto;
}

#addMovieSection {
    display: none;
}

#addMovieSection.admin-mode {
    display: block;
    animation: fadeIn 0.5s ease;
}

.movie-card {
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.movie-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 25px 50px rgba(229, 9, 20, 0.3);
    border-color: rgba(229, 9, 20, 0.5) !important;
}

/* ============================================
   7. SEARCH BOX DESIGN
   ============================================ */
.search-header {
    text-align: center;
    margin-bottom: 35px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.section-title span:last-child {
    color: var(--primary-color);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

.search-box-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 750px;
    margin: 0 auto;
    background: var(--search-bg);
    border: 1px solid var(--search-border);
    border-radius: 16px;
    padding: 6px;
    box-shadow: var(--search-shadow-inner), 0 10px 30px var(--glass-shadow);
    transition: 0.3s ease;
    position: relative;
    z-index: 10;
}

.search-box-container:focus-within {
    border-color: rgba(229, 9, 20, 0.6);
    box-shadow: var(--search-shadow-inner), 0 0 25px rgba(229, 9, 20, 0.2);
}

#movieSearchInput {
    flex: 1;
    background: transparent !important;
    border: none !important;
    color: var(--text-color) !important;
    padding: 16px 20px !important;
    font-size: 1.1rem !important;
    outline: none;
    width: 100%;
    box-shadow: none !important;
}

#movieSearchInput::placeholder {
    color: var(--text-secondary);
}

#movieSearchBtn {
    background: var(--primary-color) !important;
    color: white;
    padding: 14px 35px !important;
    border: none;
    border-radius: 12px !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: 0.3s ease;
    margin-left: 10px;
    white-space: nowrap;
}

#movieSearchBtn:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.4) !important;
}

.search-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filter-chip {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-light);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.3s;
}

.filter-chip:hover {
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.5);
    color: var(--text-color);
}

/* ============================================
   8. MOVIES GRID & CARDS CONTENT
   ============================================ */
.movies-section {
    margin-top: 60px;
    animation: fadeIn 2s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.movie-count {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    background: rgba(229, 9, 20, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    animation: pulse 2s infinite;
}

.view-controls {
    display: flex;
    gap: 10px;
}

.view-btn {
    padding: 10px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-light);
    color: var(--text-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: rgba(229, 9, 20, 0.2);
    border-color: var(--primary-color);
}

.view-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
    color: white;
}

/* 🔥 دمج كود Vanya: المسافات والعرض 280 بيكسل للكمبيوتر 🔥 */
#moviesGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
    justify-content: center;
}

.movie-card img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.movie-card:hover img {
    transform: scale(1.12);
}

.movie-card-content {
    padding: 25px;
    background: linear-gradient(to top, var(--bg-base) 0%, transparent 100%);
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.movie-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 700;
}

.movie-card .movie-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-weight: 400;
}

.movie-card .movie-info strong {
    color: var(--primary-color);
    font-weight: 600;
}

.movie-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 15px 0;
    flex: 1;
}

.movie-card a {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, #e50914 0%, #b20710 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(229, 9, 20, 0.4);
    margin-top: 18px;
}

.movie-card a:hover {
    background: linear-gradient(135deg, #ff0a16 0%, #e50914 100%);
    transform: translateY(-4px);
    box-shadow: 0 10px 35px rgba(229, 9, 20, 0.8);
}

/* ============================================
   9. INPUTS, BUTTONS & ADD FORM
   ============================================ */
input[type="text"],
input[type="number"],
input[type="url"],
select,
textarea {
    background: var(--search-bg);
    border: 1px solid var(--search-border);
    color: var(--text-color);
    padding: 16px 22px;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-family: 'Roboto', sans-serif;
    box-shadow: var(--search-shadow-inner);
    width: 100%;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(229, 9, 20, 0.3);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
}

.add-form-header {
    text-align: center;
    margin-bottom: 35px;
}

.add-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input option {
    background: var(--bg-base);
    color: var(--text-color);
}

.form-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-add {
    padding: 16px 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.4);
}

.btn-add:hover {
    background: var(--primary-hover);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.6);
}

.btn-clear {
    padding: 16px 30px;
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--glass-border-light);
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-clear:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================
   10. LOADING, ERROR & FOOTER
   ============================================ */
.loading,
.error {
    text-align: center;
    padding: 80px 20px;
    font-size: 1.6rem;
    color: var(--primary-color);
    grid-column: 1 / -1;
    animation: fadeIn 0.5s ease;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.no-results-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: swing 2s ease-in-out infinite;
}

.no-results h3 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 15px;
}

.no-results p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin-top: 100px;
    padding: 60px 20px 30px;
    border-top: 3px solid var(--primary-color);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    margin-bottom: 40px;
}

.footer-section h3,
.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 1.3rem;
}

.footer-section p {
    color: var(--text-secondary);
    margin: 8px 0;
    font-size: 0.95rem;
}

.footer-bottom {
    text-align: center;
    color: var(--text-secondary);
    padding-top: 30px;
    border-top: 1px solid var(--glass-border-light);
    font-size: 0.9rem;
}

/* ============================================
   11. SCROLLBAR & CONTROLS (LANG/THEME)
   ============================================ */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color) 0%, #b20710 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-switcher {
    display: flex;
    gap: 8px;
    background: rgba(128, 128, 128, 0.2);
    padding: 5px;
    border-radius: 25px;
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 20px;
    transition: 0.3s;
    opacity: 0.5;
    color: var(--text-color);
}

.lang-btn.active {
    background: var(--primary-color);
    opacity: 1;
    transform: scale(1.1);
    color: white;
}

.lang-btn:hover {
    opacity: 1;
}

.theme-toggle {
    background: rgba(128, 128, 128, 0.2);
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.3rem;
    transition: 0.3s;
}

.theme-toggle:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

/* RTL SUPPORT */
[dir="rtl"] .nav-container {
    flex-direction: row-reverse;
}

[dir="rtl"] .hero-stats {
    direction: rtl;
}

[dir="rtl"] .quick-actions {
    direction: rtl;
}

[dir="rtl"] .section-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-content {
    direction: rtl;
}

/* CUSTOM BADGE */
.custom-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(90deg, #e50914, #b20710);
    color: white;
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ============================================
   تعديلات حصرية لتنظيف الـ Light Mode (الهيرو)
   ============================================ */
/* إجبار قسم الهيرو إنه يفضل فخم وسينمائي (غامق) حتى في الوضع الفاتح */
body.light-mode .hero-section {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(26, 0, 0, 0.9) 100%),
        url('./bg.jpg') center/cover !important;
}

body.light-mode .hero-subtitle,
body.light-mode .stat-label,
body.light-mode .hero-scroll-indicator {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8) !important;
}

body.light-mode .stat-item {
    background: rgba(15, 15, 20, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.light-mode .scroll-arrow {
    color: var(--primary-color) !important;
}

/* ============================================
   12. RESPONSIVE DESIGN (MOBILE & TABLET)
   ============================================ */
@media (max-width: 1024px) {
    .container { padding: 20px; }
    .hero-title { font-size: 3rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .movies-grid, #moviesGrid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
}

/* 🔥 دمج كود Vanya مع تعديلاتنا لشاشات الموبايل 🔥 */
@media screen and (max-width: 768px) {
    /* 1. تظبيط البار العلوي */
    .navbar { padding: 10px 15px !important; }
    .nav-container { flex-direction: row !important; justify-content: space-between !important; align-items: center !important; gap: 5px !important; }
    .nav-brand { font-size: 1rem !important; gap: 5px !important; white-space: nowrap !important; }
    .logo-icon { font-size: 1.3rem !important; }
    .logo-text { font-size: 0.9rem !important; letter-spacing: 0 !important; }
    .nav-menu { display: none !important; }
    .nav-controls { gap: 5px !important; flex-direction: row !important; align-items: center !important; }
    .language-switcher { gap: 2px !important; padding: 3px !important; }
    .lang-btn { font-size: 0.85rem !important; padding: 4px 6px !important; }
    .theme-toggle { font-size: 1rem !important; padding: 5px 8px !important; margin: 0 !important; display: flex !important; }

    /* 2. قسم الهيرو وتصغير العنوان (كود Vanya) */
    .hero-section { min-height: 60vh !important; padding: 100px 10px 30px !important; }
    .hero-title { font-size: 1.8em !important; margin-bottom: 10px !important; }
    .hero-subtitle { font-size: 1rem !important; margin-bottom: 25px !important; }
    
    /* 🔥 الحل السحري للكروت الإحصائيات (Grid) 🔥 */
    .hero-stats { 
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important; 
        margin-top: 15px !important; 
        margin-bottom: 60px !important; 
        width: 100% !important; 
        padding: 0 10px !important;
    }
    
    .stat-item { 
        width: 100% !important;
        max-width: none !important;
        padding: 15px 10px !important; 
        border-radius: 15px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
    }

    .stat-item:last-child {
        grid-column: 1 / -1 !important;
        max-width: 50% !important;
        justify-self: center !important;
    }

    .stat-number { font-size: 1.8rem !important; margin: 0 !important; }
    .stat-label { font-size: 0.85rem !important; text-align: center !important; margin: 0 !important; }

    .hero-scroll-indicator { position: absolute !important; bottom: 15px !important; left: 50% !important; transform: translateX(-50%) !important; }
    .scroll-arrow { font-size: 1.5rem !important; }

    /* 3. تظبيط الهيدر والزراير لتاخد الشاشة كلها (كود Vanya) */
    .section-header { flex-direction: column !important; align-items: stretch !important; text-align: center !important; gap: 15px !important; }
    
    .quick-actions { flex-direction: column !important; gap: 10px !important; }
    .quick-btn, #movieSearchBtn, .btn-add { width: 100% !important; justify-content: center !important; }
    #movieSearchBtn { margin-left: 0 !important; padding: 14px 20px !important; }

    /* 4. تظبيط الجريد بتاع كروت الأفلام ليصبح 240px (كود Vanya) */
    #moviesGrid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important; gap: 15px !important; }

    /* 5. الفلاتر والبحث (كود Vanya) */
    .add-movie-section { padding: 25px 15px !important; }
    .search-box-container { flex-direction: column !important; background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; gap: 10px !important; width: 100% !important; }
    #movieSearchInput { background: var(--search-bg) !important; border: 1px solid var(--search-border) !important; border-radius: 12px !important; width: 100% !important; padding: 14px 20px !important; }
    .search-filters { flex-direction: column !important; gap: 10px !important; align-items: center !important; }
    .filter-chip { width: 100% !important; text-align: center !important; }
    
    /* 6. نافذة الإضافة (كود Vanya) */
    .add-form-container { padding: 25px !important; }

    /* 7. الفوتر */
    .footer { padding: 40px 15px 20px !important; margin-top: 50px !important; }
    .footer-content { flex-direction: column !important; gap: 25px !important; text-align: center !important; }
    .footer-section h3, .footer-section h4 { font-size: 1.2rem !important; margin-bottom: 15px !important; }
    .footer-section p { font-size: 0.9rem !important; margin: 8px 0 !important; }
    .footer-bottom { padding-top: 20px !important; margin-top: 20px !important; border-top: 1px solid rgba(255,255,255,0.1) !important; }
}

/* شاشات الموبايل الصغيرة جداً */
@media screen and (max-width: 375px) {
    .hero-title { font-size: 1.6rem !important; }
    .hero-stats { grid-template-columns: 1fr !important; }
    .stat-item:last-child { max-width: 100% !important; }
    .logo-text { display: none !important; }
}

@media (hover: none) and (pointer: coarse) {
    .quick-btn, .lang-btn, .theme-toggle, .view-btn, #movieSearchBtn, .btn-add { min-height: 44px; min-width: 44px; }
    .movie-card:active { transform: scale(0.98); }
}

