/* MDB iraq - التصميم الرئيسي - نمط IMDb */

/* الخطوط */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

/* المتغيرات */
:root {
    --primary-yellow: #F5C518;
    --bg-dark: #0F0F0F;
    --bg-darker: #121212;
    --surface: #1A1A1A;
    --text-high: #EAEAEA;
    --text-medium: #B5B5B5;
    --link-blue: #2F81F7;
    --error-red: #FF4444;
    --success-green: #4CAF50;
    --border-color: #2A2A2A;
}

/* إعادة تعيين عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    direction: rtl;
    font-size: 16px;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-high);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--link-blue);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

img {
    max-width: 100%;
    height: auto;
}

/* الحاويات */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* الهيدر */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-darker);
    transition: background 0.3s, box-shadow 0.3s;
}

.header.transparent {
    background: transparent;
}

.header.scrolled {
    background: var(--bg-darker);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    gap: 30px;
}

.header-content { position: relative; }

/* V3 Header Layout: Right=Nav, Center=Logo, Left=Search+User */
.header--v3 .header-content--v3 {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 18px 0;
    /* Keep layout stable on desktop even with RTL document direction */
    direction: ltr;
    position: relative;
}

/* Restore RTL for text/content inside header sections */
.header--v3 .header-content--v3 .nav-main,
.header--v3 .header-content--v3 .header-center,
.header--v3 .header-content--v3 .header-left {
    direction: rtl;
}

/* Mobile-style header layout for ALL sizes (prevents conflicting rules) */
.header--v3 .nav-right { display: none; }

.header--v3 .mobile-toggle {
    display: inline-flex;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
}

.header--v3 .header-center .logo-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
}

/* Keep hover transform without breaking the centering translate */
.header--v3 .header-center .logo-wrapper:hover {
    transform: translateX(-50%) scale(1.03);
}

.header--v3 .header-left {
    justify-content: flex-end;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.logo-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.2s;
}

.logo-wrapper:hover { transform: scale(1.03); }

.logo-img {
    height: 26px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.logo-text {
    font-size: 26px;
    font-weight: 800;
    color: var(--primary-yellow);
    letter-spacing: 0.5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-high);
    font-weight: 600;
    font-size: 15px;
    padding: 8px 4px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    border-bottom-color: var(--primary-yellow);
    color: var(--primary-yellow);
    opacity: 1;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: flex-start;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-yellow);
    text-decoration: none;
}

.nav-main {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-main a {
    color: var(--text-high);
    font-weight: 600;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.nav-main a:hover,
.nav-main a.active {
    border-bottom-color: var(--primary-yellow);
    opacity: 1;
}

/* البحث */
.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 45px 10px 15px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-high);
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-yellow);
}

.search-btn {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.search-btn:hover {
    background: rgba(255,255,255,0.04);
}

.search-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: var(--text-high);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.search-toggle:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
    transform: scale(1.05);
}

/* Search Overlay (Full Screen) */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.search-overlay.open {
    display: flex;
    opacity: 1;
}

.search-overlay-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

.search-close {
    position: absolute;
    top: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-high);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.search-close:hover {
    background: rgba(255,255,255,0.14);
    transform: rotate(90deg);
}

.search-overlay-content {
    max-width: 800px;
    width: 100%;
    margin-top: 80px;
}

.search-form-overlay {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 18px 24px;
    transition: all 0.3s;
}

.search-form-overlay:focus-within {
    background: rgba(255,255,255,0.08);
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 4px rgba(245, 197, 24, 0.15);
}

.search-icon {
    color: var(--text-medium);
    flex-shrink: 0;
}

.search-input-overlay {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-high);
    font-size: 20px;
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    outline: none;
}

.search-input-overlay::placeholder {
    color: var(--text-medium);
    opacity: 0.7;
}

.search-results-overlay {
    margin-top: 24px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    overflow: hidden;
    max-height: 60vh;
    overflow-y: auto;
}

.search-results {
    display: none;
    position: absolute;
    right: 0;
    top: 46px;
    z-index: 1200;
    min-width: 320px;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    overflow: hidden;
}

/* User dropdown */
.user-dropdown { position: relative; }

/* User Avatar Wrapper with Level Ring */
.user-avatar-wrapper {
    position: relative;
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s;
}

.user-avatar-wrapper:hover {
    transform: scale(1.05);
}

.level-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    pointer-events: none;
}

.level-ring-bg {
    opacity: 0.3;
}

.level-ring-progress {
    transition: stroke-dashoffset 0.5s ease;
}

.user-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--surface);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
}

.user-avatar img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

/* Login Icon Button for Guest */
.login-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border-color);
    color: var(--text-high);
    transition: all 0.3s ease;
    cursor: pointer;
}

.login-icon-btn:hover {
    border-color: var(--primary-yellow);
    background: rgba(245, 197, 24, 0.1);
    transform: translateY(-2px);
}

.login-icon-btn svg {
    flex-shrink: 0;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 240px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.55);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-menu.show { display: block; }

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text-high);
    transition: background 0.2s;
}

.dropdown-menu a:hover { background: rgba(255,255,255,0.04); }

.dropdown-menu hr {
    margin: 6px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

.user-level {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.user-level-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.level-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

.user-level-title { font-weight: 800; color: var(--text-high); }
.user-level-sub {
    font-size: 13px;
    color: var(--text-medium);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.user-level-sub .xp-line { display: inline-flex; align-items: center; gap: 8px; }
.user-level-sub .xp-triangle { display: inline-flex; width: 10px; height: 10px; }
.user-level-sub .xp-value { font-size: 13px; color: var(--text-medium); }
.xp-hint { font-size: 11px; color: var(--text-medium); opacity: 0.9; margin: 0; font-weight: 300; text-align: center; }
.xp-hint-under { margin-top: 6px; }

.user-level-bar {
    margin-top: 10px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}

.user-level-bar-fill {
    height: 100%;
    background: var(--primary-yellow);
}

/* Links for public profile + comments */
.user-link { color: var(--text-high); text-decoration: none; }
.user-link:hover { text-decoration: underline; }
.user-link.muted { color: var(--text-medium); }

/* Level icon next to display name (comments, profile, etc.) */
.level-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-inline-start: 8px;
    opacity: 0.95;
}

/* Role styling in comments (name ring + label) */
.name-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
}

.name-chip.role-admin { border-color: rgba(245,197,24,0.55); }
.name-chip.role-editor { border-color: rgba(59,130,246,0.45); }
.name-chip.role-moderator { border-color: rgba(255,255,255,0.18); }

.role-label {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-medium);
}

/* Text badge for level under names (keeps img.level-badge intact) */
.level-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-medium);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
    margin-inline-start: 8px;
}

/* Mobile nav toggle + drawer */
.mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-high);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-toggle:hover { background: rgba(255,255,255,0.04); }

/* Mobile Navigation Drawer */
.nav-mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 20px rgba(0,0,0,0.6);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-mobile-drawer.open { right: 0; }

.nav-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px;
    border-bottom: 1px solid var(--border-color);
}

.nav-mobile-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-high);
}

.nav-mobile-close {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-high);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-mobile-close:hover {
    background: rgba(255,255,255,0.08);
    transform: rotate(90deg);
}

.nav-mobile-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.nav-mobile-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: var(--text-high);
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-mobile-link:hover {
    background: rgba(255,255,255,0.04);
    color: var(--primary-yellow);
}

.nav-mobile-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-mobile-link--primary {
    margin: 8px 12px;
    border-radius: 10px;
    background: rgba(47, 129, 247, 0.12);
    color: var(--link-blue);
    justify-content: center;
    border: 1px solid rgba(47, 129, 247, 0.2);
}

.nav-mobile-link--accent {
    margin: 8px 12px;
    border-radius: 10px;
    background: var(--primary-yellow);
    color: #000;
    font-weight: 700;
    justify-content: center;
}

.nav-mobile-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 20px;
}

@media (max-width: 900px) {
    .header-content { gap: 14px; }
    .search-box { max-width: 380px; }
}

@media (max-width: 768px) {
    .header--v3 .header-content--v3 { padding: 14px 0; }
    
    .logo-img { height: 24px; max-width: 132px; }
    .logo-text { font-size: 22px; }
    
    .search-toggle {
        width: 40px;
        height: 40px;
    }
    
    .user-avatar {
        width: 38px;
        height: 38px;
    }
    
    .search-overlay-content { margin-top: 60px; }
    .search-form-overlay { padding: 14px 18px; }
    .search-input-overlay { font-size: 18px; }
    
    .search-close {
        top: 20px;
        left: 20px;
        width: 44px;
        height: 44px;
    }
}

/* أزرار الحساب */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'Cairo', sans-serif;
    font-size: 15px;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-yellow);
    color: #000;
}

.btn-primary:hover {
    background: #E5B508;
    opacity: 1;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--text-medium);
    color: var(--text-high);
}

.btn-outline:hover {
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
    opacity: 1;
}

/* Admin filters (reports) - compact, rounded inputs/buttons */
.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 14px 0 18px;
}
.admin-filters .input,
.admin-filters select,
.admin-filters input[type="date"] {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    color: var(--text-high);
    padding: 9px 12px;
    border-radius: 10px;
    min-height: 40px;
    font-size: 14px;
    outline: none;
    transition: box-shadow .12s, border-color .12s;
}
.admin-filters .input::placeholder { color: var(--text-medium); }
.admin-filters select { appearance: none; -webkit-appearance: none; padding-right: 36px; }
.admin-filters input[type="date"] { padding-right: 10px; }
.admin-filters .input:focus,
.admin-filters select:focus,
.admin-filters input[type="date"]:focus {
    border-color: rgba(245,197,24,0.35);
    box-shadow: 0 4px 12px rgba(245,197,24,0.06);
}
.admin-filters .btn { padding: 10px 18px; border-radius: 10px; }
.admin-filters .btn.btn-primary { background: var(--primary-yellow); color: #000; box-shadow: 0 6px 18px rgba(245,197,24,0.08); }
.admin-filters .btn.btn-outline { background: transparent; border-color: rgba(255,255,255,0.06); color: var(--text-medium); }
.admin-filters .btn:hover { transform: translateY(-1px); }

@media (max-width:820px) {
    .admin-filters { gap:8px; }
    .admin-filters .input, .admin-filters select, .admin-filters input[type="date"] { flex: 1 1 160px; }
    .admin-filters .btn { flex: 0 0 auto; }
}

/* Fix dropdown / select contrast for dark theme */
.admin-filters select {
    background: rgba(0,0,0,0.55);
    color: var(--text-high);
    border: 1px solid rgba(255,255,255,0.04);
}
.admin-filters select:focus { box-shadow: 0 6px 18px rgba(245,197,24,0.06); }
.admin-filters select option,
.admin-filters select optgroup { background: var(--bg-dark); color: var(--text-high); }

/* Improve date picker contrast in some browsers */
.admin-filters input[type="date"] { color: var(--text-high); background: rgba(0,0,0,0.55); }
.admin-filters input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.9); }

/* Fallback for browsers that ignore option styles: force select text color */
.admin-filters select::-ms-expand { display: inline-block; }
.admin-filters select, .admin-filters select * { color: var(--text-high) !important; }

/* Hero Carousel - Modern IMDb Style */
.hero-carousel-wrapper {
    position: relative;
    width: 100%;
    background: var(--bg-dark);
    padding: 0;
    margin: 0;
}

.hero-carousel-container {
    max-width: 1680px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    background: #000;
    /* leave room on the right for the overlay sidebar so it doesn't push content */
    padding-right: 360px;
}

.hero-main-slider {
    flex: 1;
    position: relative;
    height: 600px;
    overflow: hidden;
    background: #000;
}

.hero-slides-track {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Strong fixes to prevent slides from stacking vertically due to other CSS overrides */
.hero-carousel-wrapper, .hero-carousel-container, .hero-main-slider, .hero-slides-track {
    display: block !important;
}

.hero-main-slider {
    position: relative !important;
    height: 600px !important;
    overflow: hidden !important;
}

.hero-slides-track {
    position: relative !important;
    height: 100% !important;
}

.hero-slide {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

.hero-slide .hero-slide-content {
    max-width: 60% !important;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.hero-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    filter: brightness(0.65);
    transform: scale(1.05);
    transition: transform 8s ease;
}

.hero-slide.active .hero-slide-bg {
    transform: scale(1);
}

.hero-slide-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0,0,0,0.85) 0%,
        rgba(0,0,0,0.5) 40%,
        rgba(0,0,0,0.2) 70%,
        transparent 100%
    );
}

.hero-slide-content {
    position: absolute;
    bottom: 80px;
    left: 60px;
    right: 50%;
    z-index: 3;
    max-width: 600px;
}

.hero-slide-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 197, 24, 0.15);
    border: 1px solid rgba(245, 197, 24, 0.4);
    padding: 6px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--primary-yellow);
    font-weight: 600;
}

.badge-icon {
    font-size: 10px;
}

.hero-slide-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 12px;
    color: var(--text-high);
    text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}

.hero-slide-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 15px;
    color: var(--text-medium);
}

.hero-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 197, 24, 0.12);
    padding: 4px 10px;
    border-radius: 6px;
}

.star-icon {
    font-size: 16px;
    color: var(--primary-yellow);
}

.rating-value {
    font-weight: 700;
    color: var(--text-high);
}

.hero-slide-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-medium);
    margin-bottom: 24px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.hero-slide-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.hero-btn-primary {
    background: var(--primary-yellow);
    color: #000;
}

.hero-btn-primary:hover {
    background: #E5B508;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 197, 24, 0.3);
}

.hero-btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text-high);
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}

.hero-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
}

.hero-play-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
}

.hero-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.hero-nav-arrow:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-50%) scale(1.1);
}

.hero-nav-prev {
    left: 20px;
}

.hero-nav-next {
    right: 20px;
}

/* Sidebar - Up Next */
.hero-sidebar {
    /* Make Up Next overlay on top of hero instead of a separate column */
    position: absolute;
    right: 24px;
    top: 24px;
    width: 320px;
    max-height: calc(100% - 48px);
    z-index: 30;
    background: rgba(0,0,0,0.35); /* semi-transparent so hero art shows through */
    padding: 14px 12px;
    border-left: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border-radius: 8px;
    overflow-y: auto;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-yellow);
}

.sidebar-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease;
    background: transparent;
    align-items: center;
}

.sidebar-item:hover,
.sidebar-item.active {
    background: rgba(255,255,255,0.04);
}

.sidebar-item-thumb {
    position: relative;
    width: 64px;
    height: 96px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a1a;
}

.sidebar-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-item-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.12s ease;
}

.sidebar-item:hover .sidebar-item-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
}

.sidebar-item-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.sidebar-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.sidebar-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-high);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-medium);
}

.sidebar-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-yellow);
    font-weight: 600;
}

.sidebar-browse-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--link-blue);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.18s ease;
}

.sidebar-browse-link:hover {
    color: var(--primary-yellow);
}

/* Fallback Welcome */
.hero-welcome {
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    padding: 120px 20px;
    text-align: center;
}

.hero-welcome h1 {
    font-size: 48px;
    color: var(--primary-yellow);
    margin-bottom: 20px;
}

.hero-welcome p {
    font-size: 18px;
    color: var(--text-medium);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive */
@media (max-width: 1280px) {
    .hero-carousel-container { padding-right: 300px; }
    .hero-sidebar { right: 18px; width: 300px; }
    .sidebar-item-thumb { width: 84px; height: 124px; }
}

@media (max-width: 992px) {
    .hero-sidebar { display: none; }
    .hero-carousel-container { padding-right: 0; }
    .hero-main-slider { height: 500px; }
    .hero-slide-content { left: 20px; right: 20px; bottom: 40px; max-width: 100%; }
    .hero-slide-title { font-size: 36px; }
    .hero-nav-arrow { width: 48px; height: 48px; }
}

@media (max-width: 768px) {
    .hero-main-slider {
        height: 420px;
    }
    
    .hero-slide-title {
        font-size: 28px;
    }
    
    .hero-slide-description {
        font-size: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .hero-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .hero-nav-arrow {
        width: 40px;
        height: 40px;
    }
    
    .hero-nav-prev {
        left: 10px;
    }
    
    .hero-nav-next {
        right: 10px;
    }
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4) blur(2px);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-dark) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 16px;
}

.hero-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-badge {
    background: var(--primary-yellow);
    color: #000;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hero-plot {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 30px;
    color: var(--text-medium);
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* الأقسام */
.section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
}

.section-link {
    color: var(--link-blue);
    font-weight: 600;
}

/* بطاقات الأفلام */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* Slider layout (horizontal, draggable/scrollable) */
.cards-slider {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 6px 2px 14px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.cards-slider::-webkit-scrollbar { height: 10px; }
.cards-slider::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 999px; }
.cards-slider::-webkit-scrollbar-thumb { background: rgba(245, 197, 24, 0.30); border-radius: 999px; }

.cards-slider .movie-card {
    flex: 0 0 190px;
    scroll-snap-align: start;
}

@media (max-width: 768px) {
    .cards-slider .movie-card { flex-basis: 160px; }
}

.movie-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.movie-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

/* Poster wrapper with overlay action icons */
.movie-poster-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #0f0f0f;
}

/* IMDb Badge - Top Right Corner */
.imdb-badge {
    position: absolute;
    top: 8px;
    right: 8px; /* right corner in RTL */
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 7;
    color: var(--primary-yellow);
    font-weight: 700;
    font-size: 13px;
}

.imdb-badge svg {
    fill: var(--primary-yellow);
}

.imdb-logo {
    width: 36px;
    height: 16px;
    display: block;
}

.iraq-flag {
    width: 18px;
    height: 12px;
    display: inline-block;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08) inset;
}

.poster-actions {
    position: absolute;
    top: 8px;
    left: 8px; /* left because RTL; icons appear on left-top over poster */
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 6;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.icon-btn:hover { transform: translateY(-3px); background: rgba(0,0,0,0.7); }

.icon-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.icon-btn.active {
    background: rgba(245, 197, 24, 0.22);
    border: 1px solid rgba(245, 197, 24, 0.35);
    color: var(--primary-yellow);
}

/* Footer layout: title + meta (year + rating) */
.movie-footer {
    padding: 12px 14px;
    background: transparent;
}

.movie-title { 
    font-size: 15px; 
    margin: 0 0 8px 0; 
    font-weight: 700; 
    color: var(--text-high);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: right;
}

.movie-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    font-size: 13px;
    color: var(--text-medium);
}

.movie-year {
    color: var(--text-medium);
}

.site-rating-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(245, 197, 24, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--primary-yellow);
    font-weight: 700;
}

.site-rating-inline svg {
    fill: var(--primary-yellow);
}

.movie-info {
    padding: 12px;
}

.movie-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-medium);
}

.movie-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-yellow);
}

/* التقييم بالنجوم */
.rating-stars {
    display: flex;
    gap: 5px;
}

.star {
    font-size: 24px;
    color: var(--border-color);
    cursor: pointer;
    transition: color 0.2s;
}

.star.filled {
    color: var(--primary-yellow);
}

.star:hover,
.star.hover {
    color: var(--primary-yellow);
}

/* الترقيم */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    background: var(--surface);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.pagination a:hover {
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
}

.pagination .active {
    background: var(--primary-yellow);
    color: #000;
    border-color: var(--primary-yellow);
}

/* الفوتر */
.footer {
    background: var(--bg-darker);
    padding: 50px 0 30px;
    margin-top: 80px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    text-align: center;
    color: var(--text-medium);
}

.footer-logo-wrap {
    display: inline-block;
    margin-bottom: 20px;
}

.footer-logo-img {
    max-width: 200px;
    height: 48px;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.footer-logo-text {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-yellow);
}

.footer-desc {
    font-size: 15px;
    color: var(--text-medium);
    margin: 15px 0 25px 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-high);
    font-weight: 600;
    transition: color 0.2s;
}

/* Toast notifications (showAlert) */
.toast-container {
    position: fixed;
    top: 90px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
    pointer-events: none;
}

.toast {
    min-width: 240px;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text-high);
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
    transform: translateY(-6px);
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: auto;
    cursor: pointer;
    font-weight: 600;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { border-color: rgba(34, 197, 94, 0.35); }
.toast-error { border-color: rgba(239, 68, 68, 0.45); }
.toast-info { border-color: rgba(59, 130, 246, 0.35); }
.toast-warning { border-color: rgba(245, 197, 24, 0.35); }

.footer-links a:hover {
    color: var(--primary-yellow);
}

.footer-copy {
    margin-top: 30px;
    font-size: 14px;
    color: var(--text-low);
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .hero {
        height: 50vh;
        min-height: 400px;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .nav-main {
        display: none;
    }
    
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .section {
        padding: 40px 0;
    }
}

/* الأدوات المساعدة */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }

/* نمط الحقول والأزرار الصغيرة (التعليقات والردود) */
.form-input {
    width: 100%;
    padding: 10px 12px;
    background: #0f0f0f;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-high);
    resize: vertical;
    font-size: 14px;
}
.form-input:focus { outline: none; border-color: var(--primary-yellow); box-shadow: 0 0 0 4px rgba(245,197,24,0.06);} 

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-medium);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-ghost:hover { color: var(--primary-yellow); }

.comment-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 12px;
}

/* Admin reports - card grid */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}
.report-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.03);
}

/* Shared UI primitives (used by Settings + Admin pages) */
.page-wrap { padding-top: 80px; padding-bottom: 60px; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom: 16px; }
.page-subtitle { margin-top: 6px; color: var(--text-medium); font-size: 14px; }
.muted { color: var(--text-medium); }
.link { color: var(--link-blue); }

.card { background: var(--surface); border: 1px solid rgba(255,255,255,0.04); border-radius: 12px; padding: 18px; }
.card-title { font-weight: 800; font-size: 18px; margin-bottom: 12px; }
.empty { padding: 18px; text-align: center; color: var(--text-medium); }

.stack { display:flex; flex-direction:column; gap: 14px; }
.form-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

.field label { display:block; margin-bottom: 8px; font-weight: 600; }
.field .hint { margin-top: 6px; font-size: 12px; color: var(--text-medium); }

.settings-shell { max-width: 720px; margin: 0 auto; }
.settings-avatar { display:flex; align-items:center; gap: 16px; flex-wrap:wrap; }
.settings-avatar img,
.settings-avatar .avatar-circle { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary-yellow); }
.settings-avatar .avatar-circle { background: rgba(255,255,255,0.08); display:flex; align-items:center; justify-content:center; font-size: 40px; color: #fff; }
.settings-actions { display:flex; justify-content:center; gap: 12px; flex-wrap:wrap; margin-top: 6px; }

.admin-page { padding-top: 80px; padding-bottom: 60px; }
.admin-header { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom: 14px; }
.admin-title { margin: 0; }
.admin-subtitle { margin-top: 6px; color: var(--text-medium); font-size: 14px; }
.admin-tabs { display:flex; gap: 8px; flex-wrap:wrap; }
.tab { padding: 8px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); color: var(--text-medium); text-decoration:none; }
.tab:hover { opacity: 1; border-color: rgba(255,255,255,0.12); }
.tab.active { background: rgba(245,197,24,0.12); border-color: rgba(245,197,24,0.25); color: var(--primary-yellow); }

.avatar-circle {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: var(--text-medium);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    border: 3px solid var(--primary-yellow);
}
.pager { display:flex; gap: 8px; flex-wrap:wrap; margin-top: 16px; }
.report-card-left { display:flex; gap:10px; align-items:center; min-width:120px; }
.report-card-left .avatar-sm { width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,0.04); font-weight:700 }
.report-meta { display:flex; flex-direction:column; gap:2px }
.report-user { font-weight:700; color:var(--text-high) }
.report-date { font-size:12px; color:var(--text-medium) }
.report-card-body { flex:1; display:flex; flex-direction:column; gap:8px }
.report-target .preview { margin-top:6px; font-size:13px; color:var(--text-medium); max-height:44px; overflow:hidden }
.report-reason { font-size:14px; color:var(--text-high); white-space:pre-wrap }
.report-card-right { display:flex; flex-direction:column; gap:8px; align-items:flex-end }
.report-actions .btn { margin-left:6px }
.status-wrap { margin-bottom:6px }

.status-badge { padding:6px 8px; border-radius:999px; font-size:12px; font-weight:600 }
.status-pending { background: rgba(245,197,24,0.08); color:var(--primary-yellow) }
.status-resolved { background: rgba(39,174,96,0.08); color:#27AE60 }
.status-dismissed { background: rgba(200,200,200,0.06); color:var(--text-medium) }

@media (max-width:720px) {
    .report-card { flex-direction:row; }
    .report-card-right { align-items:flex-start }
}

/* Report detail styles */
.report-detail-card {
    background: var(--surface);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.page-title { margin-bottom: 12px; }
.rd-header { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.rd-title { font-weight:700; color:var(--text-medium); }
.rd-value { font-weight:700; color:var(--text-high); }
.rd-name.muted { font-weight:400; color:var(--text-medium); margin-left:6px }
.rd-row { display:flex; gap:16px; margin-top:12px; }
.rd-col { flex:1 }
.rd-label { font-size:13px; color:var(--text-medium); margin-bottom:6px }
.rd-preview { margin-top:6px; font-size:13px; color:var(--text-medium); }
.rd-section { margin-top:14px }
.rd-content { background: rgba(0,0,0,0.04); padding:12px; border-radius:8px; color:var(--text-high) }

.rd-related-card { display:flex; gap:12px; align-items:center; background:var(--surface); padding:10px; border-radius:10px; border:1px solid rgba(255,255,255,0.03) }
.rd-poster { width:72px; height:96px; object-fit:cover; border-radius:6px }
.rd-related-meta .rd-related-title { font-weight:800 }

.rd-box { background:var(--surface); padding:12px; border-radius:8px; border:1px solid rgba(255,255,255,0.03); }
.rd-box-title { font-weight:700 }
.rd-box-body { margin-top:8px }

.rd-comment-card { display:flex; gap:12px; background:var(--surface); padding:12px; border-radius:10px; border:1px solid rgba(255,255,255,0.03) }
.rd-avatar img { width:56px; height:56px; border-radius:50%; object-fit:cover }
.avatar-fallback { width:56px; height:56px; border-radius:50%; background:var(--text-medium); display:flex; align-items:center; justify-content:center; color: #fff; font-weight:700 }
.rd-comment-body { flex:1 }
.rd-comment-author { font-weight:700 }
.rd-comment-text { margin-top:8px; color:var(--text-high) }
.rd-actions { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap }
.rd-actions .btn { padding:8px 12px; border-radius:8px }

@media (max-width:720px) {
    .rd-row { flex-direction:column }
    .rd-header { flex-direction:column; align-items:flex-start }
}

/* Modal styles for ban dialog */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    padding: 20px;
}
.modal {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid rgba(255,255,255,0.02) }
.modal-header h3 { margin:0 }
.modal-close { background:transparent; border:none; font-size:20px; cursor:pointer; color:var(--text-medium) }
.modal-body { padding:14px 16px }
.modal-footer { padding:12px 16px; display:flex; gap:8px; justify-content:flex-end; border-top:1px solid rgba(255,255,255,0.02) }
.modal .input { width:100%; }

/* Report modal options */
.report-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
    cursor: pointer;
}
.report-option:hover { border-color: rgba(255,255,255,0.12); }
.report-option input { accent-color: var(--primary-yellow); }

/* Avatar ring + role tag (admin/editor/mod) */
.avatar-wrap { position: relative; width: 56px; height: 56px; }
.avatar-wrap .avatar-img,
.avatar-wrap .avatar-fallback {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid rgba(255,255,255,0.10);
}
.avatar-wrap.role-admin .avatar-img,
.avatar-wrap.role-admin .avatar-fallback { border-color: rgba(245,197,24,0.65); }
.avatar-wrap.role-editor .avatar-img,
.avatar-wrap.role-editor .avatar-fallback { border-color: rgba(59,130,246,0.55); }
.avatar-wrap.role-moderator .avatar-img,
.avatar-wrap.role-moderator .avatar-fallback { border-color: rgba(255,255,255,0.22); }

.role-tag {
    position: absolute;
    bottom: -8px;
    inset-inline-end: -6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: var(--surface);
    color: var(--text-high);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    white-space: nowrap;
}

/* Bigger level icon + rating */
.level-icon { width: 28px; height: 28px; margin-inline-start: 8px; }
.comment-rating { font-size: 16px; font-weight: 800; color: var(--primary-yellow); }

/* Role badge beside username (used in title reviews/replies) */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    margin-inline-start: 8px;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.02);
}
.role-badge.role-admin,
.role-badge.role-moderator {
    color: var(--error-red);
    border-color: rgba(255,68,68,0.55);
    background: rgba(255,68,68,0.08);
}
.role-badge.role-editor {
    color: var(--link-blue);
    border-color: rgba(47,129,247,0.45);
    background: rgba(47,129,247,0.10);
}

/* Make level badge larger for people who wrote reviews */
.comment-card .level-icon { width: 36px; height: 36px; }
.reply-card .level-icon { width: 32px; height: 32px; }

/* Slightly refine action buttons in report detail */
.rd-actions .btn { min-width:80px; }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,0.03); color: var(--text-high); }
.btn-danger { background: #E04B4B; color: #fff; }

/* Button icon spacing */
.btn .icon { display:inline-flex; align-items:center; justify-content:center; margin-inline-end:8px; }
.btn .icon svg { display:block }

.comment-meta { display:flex; gap:10px; align-items:center; }
.comment-author { font-weight:700; }
.comment-body { 
    margin-top:8px; 
    color:var(--text-high); 
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    max-width: 100%;
}
.comment-actions { margin-top:10px; display:flex; gap:8px; align-items:center; flex-wrap: wrap; }

/* make title action buttons smaller and consistent */
.title-actions .btn {
    padding: 10px 14px;
    border-radius: 10px;
}

/* ensure form inputs (comment/reply) are visually larger */
.form-input {
    min-height: 44px;
}

/* likes count styling */
.likes-count { margin-inline-start:6px; color: var(--text-high); font-weight:600; }

.reply-card { margin-top:10px; padding:10px; background: rgba(255,255,255,0.02); border-radius:10px; border:1px solid var(--border-color); }
.reply-meta { font-weight:700; font-size:13px; }
.reply-body { 
    margin-top:6px; 
    font-size:14px; 
    color:var(--text-high); 
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    max-width: 100%;
}

@media (max-width: 768px) {
    .title-header { flex-direction: column; align-items: center; }
    .title-poster img { width: 220px; }
}

/* أيقونات مسطحة */
.icon-flat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--text-medium);
}
.btn-ghost .icon-flat,
.btn-outline .icon-flat,
.btn-primary .icon-flat {
    margin-inline-start: 6px; /* spacing between icon and text in rtl */
}
.icon-flat svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    stroke: none;
    vertical-align: middle;
}
.btn-ghost .icon-flat:hover,
.btn-outline .icon-flat:hover,
.btn-primary .icon-flat:hover {
    color: var(--primary-yellow);
}
/* ==========================================
   Chat Widget (Messenger Style)
   ========================================== */

.chat-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    font-family: 'Cairo', sans-serif;
}

.chat-widget.hidden {
    display: none;
}

/* Toggle Button */
.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-yellow) 0%, #f39c12 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(245, 197, 24, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(245, 197, 24, 0.6);
}

.chat-toggle svg {
    width: 28px;
    height: 28px;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--error-red);
    color: #fff;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    height: 550px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s ease;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #1A1A1A 0%, #2A2A2A 100%);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-high);
    font-weight: 600;
    font-size: 16px;
}

.chat-header-title svg {
    color: var(--primary-yellow);
}

.chat-header-actions {
    display: flex;
    gap: 6px;
}

.chat-btn-icon {
    background: transparent;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    font-size: 20px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.chat-btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-high);
}

/* Typing Indicator */
.chat-typing {
    padding: 8px 16px;
    background: rgba(245, 197, 24, 0.1);
    border-bottom: 1px solid rgba(245, 197, 24, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--primary-yellow);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--primary-yellow);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* Messages Container */
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-darker);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-medium);
}

.loader {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-yellow);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message Bubble */
.chat-message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-avatar-fallback {
    width: 100%;
    height: 100%;
    background: var(--primary-yellow);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.chat-message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-message.own .chat-message-content {
    align-items: flex-end;
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.chat-username {
    font-weight: 600;
    color: var(--text-high);
}

.chat-time {
    color: var(--text-medium);
    font-size: 11px;
}

.chat-role-badge {
    background: var(--primary-yellow);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.chat-bubble {
    background: var(--surface);
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
    color: var(--text-high);
    line-height: 1.5;
}

.chat-message.own .chat-bubble {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, #f39c12 100%);
    color: #000;
}

.chat-bubble-reply {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    border-left: 3px solid var(--primary-yellow);
    font-size: 12px;
    color: var(--text-medium);
}

.chat-message.own .chat-bubble-reply {
    border-left: 3px solid rgba(0, 0, 0, 0.3);
}

.chat-bubble img {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 6px;
}

/* Message Actions */
.chat-message-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.chat-message:hover .chat-message-actions {
    opacity: 1;
}

.chat-message-action {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-medium);
}

.chat-message-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-high);
}

/* Reactions */
.chat-reactions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.chat-reaction {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-reaction:hover {
    background: rgba(245, 197, 24, 0.2);
    border-color: var(--primary-yellow);
}

.chat-reaction.active {
    background: var(--primary-yellow);
    color: #000;
    border-color: var(--primary-yellow);
}

/* Reply Preview */
.chat-reply-preview {
    padding: 10px 16px;
    background: rgba(245, 197, 24, 0.1);
    border-top: 1px solid rgba(245, 197, 24, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reply-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reply-label {
    font-size: 11px;
    color: var(--primary-yellow);
    font-weight: 600;
}

.reply-text {
    font-size: 13px;
    color: var(--text-medium);
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Input Area */
.chat-input-area {
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-input {
    flex: 1;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 14px;
    color: var(--text-high);
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-yellow);
}

.chat-input::-webkit-scrollbar {
    width: 4px;
}

.chat-input::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.chat-send-btn {
    background: var(--primary-yellow);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(245, 197, 24, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

.chat-send-btn svg {
    color: #000;
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 70px;
    left: 16px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-item {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

.emoji-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Reaction Picker Overlay */
.reaction-picker-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    gap: 8px;
    animation: reactionPopIn 0.2s ease;
}

@keyframes reactionPopIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.reaction-picker-overlay button {
    background: transparent;
    border: none;
    font-size: 32px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s, transform 0.2s;
}

.reaction-picker-overlay button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
}

/* Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        left: 0;
        border-radius: 0;
    }
    
    .chat-toggle {
        width: 56px;
        height: 56px;
    }
}