/* =====================================================
   Advanced Digital Projects Marketplace - Royal Theme
   Version 2.0 | 2026
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&family=Playfair+Display:wght@400;500;600;700;800;900&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
    --primary: #c8a45c;
    --primary-light: #e8cc7e;
    --primary-dark: #9e7d3a;
    --secondary: #1a1a2e;
    --accent: #6c63ff;
    --accent-light: #8b84ff;
    --gold: #d4af37;
    --gold-light: #f5d76e;
    --bg-dark: #0a0a14;
    --bg-card: rgba(26, 26, 46, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6c6c80;
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-gold: rgba(200, 164, 92, 0.3);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(200, 164, 92, 0.15);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.4);
    --gradient-royal: linear-gradient(135deg, #c8a45c 0%, #e8cc7e 50%, #c8a45c 100%);
    --gradient-dark: linear-gradient(135deg, #0a0a14 0%, #1a1a2e 50%, #16213e 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 100%);
    --gradient-accent: linear-gradient(135deg, #6c63ff 0%, #c8a45c 100%);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --font-ar: 'Tajawal', sans-serif;
    --font-en-display: 'Playfair Display', serif;
    --font-en-body: 'DM Sans', sans-serif;
    --transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-fast: all 0.2s ease;
}

/* ===== Light Mode ===== */
html.light-mode body,
body.light-mode {
    --bg-dark: #f4f4f8 !important;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.75);
    --bg-glass-hover: rgba(255, 255, 255, 0.95);
    --text-primary: #1a1a2e;
    --text-secondary: #3a3a5e;
    --text-muted: #7a7a9e;
    --border-glass: rgba(0, 0, 0, 0.08);
    --border-gold: rgba(160, 130, 60, 0.25);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 30px rgba(200, 164, 92, 0.08);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.05);
    --secondary: #ffffff;
    background: #f4f4f8 !important;
    color: #1a1a2e !important;
}

body.light-mode::before {
    background: radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.03) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(200, 164, 92, 0.02) 0%, transparent 50%) !important;
}

body.light-mode .navbar { background: rgba(255, 255, 255, 0.92) !important; border-bottom-color: rgba(0,0,0,0.06) !important; }
body.light-mode .navbar.scrolled { background: rgba(255, 255, 255, 0.98) !important; box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important; }
body.light-mode .nav-links a { color: #4a4a6e; }
body.light-mode .nav-links a:hover, body.light-mode .nav-links a.active { color: var(--primary); }
body.light-mode .nav-links { background: rgba(255,255,255,0.98) !important; }

body.light-mode .nav-logo .gold-text { -webkit-text-fill-color: #8b6d2e; }

body.light-mode .hero::before { opacity: 0.3; }
body.light-mode .hero p { color: #5a5a7e; }

body.light-mode .footer { background: #e8e8ee !important; border-top-color: rgba(0,0,0,0.05) !important; }
body.light-mode .footer h4 { color: #8b6d2e; }
body.light-mode .footer-links a { color: #5a5a7e; }
body.light-mode .footer-bottom { color: #8a8a9e; border-top-color: rgba(0,0,0,0.06); }

body.light-mode .glass-card {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
body.light-mode .glass-card:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(160, 130, 60, 0.2) !important;
}

body.light-mode .project-card .card-body h3 a { color: #1a1a2e; }
body.light-mode .card-meta { color: #7a7a9e; }
body.light-mode .card-footer { border-top-color: rgba(0,0,0,0.06); }

body.light-mode .filter-select,
body.light-mode .filter-input,
body.light-mode .form-group input,
body.light-mode .form-group textarea,
body.light-mode .form-group select,
body.light-mode .code-input-group input {
    background-color: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #1a1a2e !important;
}
body.light-mode .filter-select option,
body.light-mode .form-group select option,
body.light-mode select option {
    background-color: #ffffff !important;
    color: #1a1a2e !important;
}

body.light-mode .modal-overlay { background: rgba(0,0,0,0.4); }
body.light-mode .modal-content { background: #ffffff !important; border-color: rgba(0,0,0,0.08) !important; }

body.light-mode .bank-info { background: rgba(0,0,0,0.02); }
body.light-mode .bank-info-row { border-bottom-color: rgba(0,0,0,0.06); }
body.light-mode .bi-label { color: #6a6a8e; }

body.light-mode .payment-tab { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); color: #5a5a7e; }
body.light-mode .payment-tab.active { background: rgba(200,164,92,0.1); border-color: rgba(200,164,92,0.3); color: #8b6d2e; }

body.light-mode .no-image { background: linear-gradient(135deg, #e8e8ee, #d8d8de); }
body.light-mode .badge-free { background: rgba(34,197,94,0.1); }
body.light-mode .badge-paid { background: rgba(200,164,92,0.1); }
body.light-mode .badge-preview { background: rgba(108,99,255,0.1); }

body.light-mode .stat-card .stat-icon { background: rgba(200,164,92,0.08); }

body.light-mode .info-list li { border-bottom-color: rgba(0,0,0,0.05); }
body.light-mode .info-list .label { color: #7a7a9e; }

body.light-mode .section-header h2::after { background: linear-gradient(135deg, #a0842e, #c8a45c); }

body.light-mode ::-webkit-scrollbar-track { background: #ededf2; }
body.light-mode ::-webkit-scrollbar-thumb { background: rgba(160,130,60,0.25); }

body.light-mode .ad-popup-container { background: rgba(0,0,0,0.3); }

body.light-mode .lang-switch { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
body.light-mode .lang-switch a { color: #7a7a9e; }

body.light-mode .toast { background: #ffffff; border-color: rgba(200,164,92,0.2); color: #1a1a2e; box-shadow: 0 8px 30px rgba(0,0,0,0.1); }

/* Theme Toggle Button */
.theme-toggle {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-glass);
    background: var(--bg-glass);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}
.theme-toggle:hover {
    background: rgba(200, 164, 92, 0.1);
    color: var(--primary);
    border-color: var(--border-gold);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-ar);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

body[dir="ltr"] {
    font-family: var(--font-en-body);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(108, 99, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(200, 164, 92, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(108, 99, 255, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

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

img { max-width: 100%; height: auto; }

/* ===== Utility Classes ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.glass-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-gold);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.gold-text {
    background: var(--gradient-royal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gold-border {
    border: 1px solid var(--border-gold);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-royal);
    color: var(--bg-dark);
    box-shadow: 0 4px 20px rgba(200, 164, 92, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(200, 164, 92, 0.5);
    color: var(--bg-dark);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-gold);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(200, 164, 92, 0.1);
    border-color: var(--primary);
    color: var(--primary-light);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-free {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-paid {
    background: rgba(200, 164, 92, 0.15);
    color: var(--primary);
    border: 1px solid var(--border-gold);
}

.badge-preview {
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent-light);
    border: 1px solid rgba(108, 99, 255, 0.2);
}

.badge-featured {
    background: var(--gradient-royal);
    color: var(--bg-dark);
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    background: rgba(10, 10, 20, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 10px 0;
    background: rgba(10, 10, 20, 0.95);
    box-shadow: var(--shadow-soft);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 800;
}

.nav-logo .logo-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-royal);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(200, 164, 92, 0.3);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-links a {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(200, 164, 92, 0.08);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lang-switch a {
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.lang-switch a.active {
    background: var(--gradient-royal);
    color: var(--bg-dark);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 20px 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(200, 164, 92, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(108, 99, 255, 0.08) 0%, transparent 40%);
    animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-0.5deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    border-radius: 30px;
    background: rgba(200, 164, 92, 0.1);
    border: 1px solid var(--border-gold);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease 0.1s both;
}

body[dir="ltr"] .hero h1 {
    font-family: var(--font-en-display);
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.3s both;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

.animate-in { animation: fadeInUp 0.6s ease both; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ===== Stats Section ===== */
.stats-section {
    padding: 60px 0;
    position: relative;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    text-align: center;
    padding: 32px 20px;
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: rgba(200, 164, 92, 0.1);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== Section Headers ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    position: relative;
}

body[dir="ltr"] .section-header h2 {
    font-family: var(--font-en-display);
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-royal);
    border-radius: 2px;
}

body[dir="rtl"] .section-header h2::after {
    left: auto;
    right: 0;
}

/* ===== Projects Grid ===== */
.projects-section {
    padding: 80px 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ===== Project Card - 3D ===== */
.project-card {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-card .card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.project-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .card-image img {
    transform: scale(1.08);
}

.project-card .card-image .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 20, 0.8) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 16px;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .card-image .overlay {
    opacity: 1;
}

.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    z-index: 2;
}

body[dir="rtl"] .card-badges {
    flex-direction: row-reverse;
}

.card-body {
    padding: 20px;
}

.card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-body h3 a {
    color: var(--text-primary);
}

.card-body h3 a:hover {
    color: var(--primary);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 16px;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
}

.card-price {
    font-size: 1.2rem;
    font-weight: 800;
}

.card-price.free {
    color: #22c55e;
}

.card-price.paid {
    color: var(--primary);
}

/* ===== Filters Bar ===== */
.filters-bar {
    padding: 24px;
    margin-bottom: 32px;
}

.filters-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.filter-select, .filter-input {
    width: 100%;
    padding: 10px 16px;
    background-color: #1a1a2e;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.filter-select option,
.form-group select option,
select option {
    background-color: #1a1a2e;
    color: #f0f0f0;
    padding: 10px;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.1);
}

.filter-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

body[dir="ltr"] .filter-select {
    background-position: right 12px center;
    padding-left: 16px;
    padding-right: 36px;
}

/* ===== Project Detail Page ===== */
.project-detail {
    padding: 120px 0 80px;
}

.project-hero {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    margin-bottom: 40px;
}

.project-gallery {
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/10;
}

.project-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info-card {
    padding: 32px;
}

.project-info-card .price-tag {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 24px;
}

.info-list {
    list-style: none;
    margin-bottom: 24px;
}

.info-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.92rem;
}

.info-list li:last-child { border-bottom: none; }

.info-list .label {
    color: var(--text-muted);
}

.info-list .value {
    font-weight: 600;
}

.project-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-description {
    padding: 32px;
    line-height: 1.9;
    color: var(--text-secondary);
}

/* ===== Payment Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px;
    position: relative;
    animation: scaleIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

body[dir="rtl"] .modal-close {
    right: auto;
    left: 16px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.modal-content h3 {
    font-size: 1.4rem;
    margin-bottom: 24px;
    font-weight: 700;
}

.payment-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.payment-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition-fast);
}

.payment-tab.active {
    background: rgba(200, 164, 92, 0.15);
    border-color: var(--border-gold);
    color: var(--primary);
}

.bank-info {
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.bank-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-glass);
}

.bank-info-row:last-child { border-bottom: none; }

.bank-info-row .bi-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.bank-info-row .bi-value {
    font-weight: 600;
    font-size: 0.9rem;
    direction: ltr;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background-color: #1a1a2e;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== Download Code Section ===== */
.download-code-section {
    padding: 24px;
    text-align: center;
    margin-top: 20px;
}

.code-input-group {
    display: flex;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.code-input-group input {
    flex: 1;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-align: center;
    text-transform: uppercase;
}

.code-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== Live Preview ===== */
.preview-frame-container {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 32px;
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-glass);
}

.preview-dots {
    display: flex;
    gap: 8px;
}

.preview-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.preview-dots span:nth-child(1) { background: #ff5f57; }
.preview-dots span:nth-child(2) { background: #febc2e; }
.preview-dots span:nth-child(3) { background: #28c840; }

.preview-frame {
    width: 100%;
    height: 600px;
    border: none;
    background: #fff;
}

/* ===== Ads - All Types ===== */
.ads-section {
    margin: 24px 0;
}

.ads-slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.ads-slider .ad-slide,
.ads-slider .ad-item {
    display: none;
}

.ads-slider .ad-slide:first-child,
.ads-slider .ad-item:first-child {
    display: block;
}

.ads-slider img,
.ad-item.ad-slider img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    display: block;
}

.ad-item.ad-banner {
    margin: 20px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ad-item.ad-banner img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius-md);
    display: block;
}

.google-ad-container {
    margin: 24px 0;
    min-height: 90px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* ===== Footer ===== */
.footer {
    background: rgba(10, 10, 20, 0.95);
    border-top: 1px solid var(--border-glass);
    padding: 60px 0 24px;
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary);
    padding-inline-start: 8px;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    transition: var(--transition);
}

.footer-social a:hover {
    background: rgba(200, 164, 92, 0.15);
    border-color: var(--border-gold);
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.pagination a {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.pagination a:hover, .pagination a.active {
    background: var(--gradient-royal);
    border-color: var(--primary);
    color: var(--bg-dark);
}

.pagination span.dots {
    color: var(--text-muted);
}

/* ===== Order Success ===== */
.order-success {
    text-align: center;
    padding: 24px;
}

.order-success .check-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: rgba(34, 197, 94, 0.15);
    border: 2px solid rgba(34, 197, 94, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #22c55e;
}

.order-token {
    font-family: monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--bg-glass);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-gold);
    display: inline-block;
    margin: 12px 0;
}

/* ===== Contact Page ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
}

.contact-info-card .ci-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: rgba(200, 164, 92, 0.1);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
}

/* ===== Pages (About, Privacy, Terms) ===== */
.page-section {
    padding: 120px 0 80px;
}

.page-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-content h1 {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 24px;
}

body[dir="ltr"] .page-content h1 {
    font-family: var(--font-en-display);
}

.page-content p {
    color: var(--text-secondary);
    line-height: 2;
    margin-bottom: 20px;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

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

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

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--secondary);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    color: var(--text-primary);
    font-weight: 600;
    z-index: 10000;
    animation: slideInRight 0.4s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-card);
}

body[dir="rtl"] .toast {
    right: auto;
    left: 24px;
    animation: slideInLeft 0.4s ease;
}

/* ===== No Image Placeholder ===== */
.no-image {
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
}

/* ===== Loading Skeleton ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-glass) 25%, rgba(255,255,255,0.08) 50%, var(--bg-glass) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ===== Responsive - Desktop (max-width: 1280px) ===== */
@media (max-width: 1280px) {
    .container { max-width: 1100px; }
    .projects-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* ===== Responsive - Tablet Landscape (max-width: 1024px) ===== */
@media (max-width: 1024px) {
    .container { max-width: 95%; padding: 0 16px; }
    .project-hero { grid-template-columns: 1fr; gap: 24px; }
    .project-info-card { max-width: 100%; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .projects-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
    .hero h1 { font-size: 2.4rem; }
    .hero { padding: 100px 16px 60px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .section-header h2 { font-size: 1.5rem; }
    .modal-content { max-width: 90vw; padding: 28px; }
    .contact-grid { grid-template-columns: 1fr; }
}

/* ===== Responsive - Tablet Portrait (max-width: 768px) ===== */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: rgba(10, 10, 20, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-glass);
        max-height: 70vh;
        overflow-y: auto;
    }
    .nav-links.active { display: flex; }
    .nav-links a { padding: 12px 16px; font-size: 1rem; }
    .mobile-toggle { display: block; }
    .nav-logo span.gold-text { font-size: 1rem; }
    .logo-icon { width: 36px; height: 36px; font-size: 1rem; }

    .hero { padding: 90px 12px 50px; min-height: auto; }
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 0.95rem; }
    .hero-actions { flex-direction: column; gap: 10px; }
    .hero-actions .btn { width: 100%; }
    .hero-badge { font-size: 0.78rem; padding: 6px 16px; }

    .projects-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .project-card .card-image { height: 160px; }
    .card-body { padding: 14px; }
    .card-body h3 { font-size: 0.95rem; }
    .card-meta { font-size: 0.75rem; gap: 8px; }
    .card-price { font-size: 1rem; }

    .filters-bar { padding: 16px; }
    .filters-row { flex-direction: column; gap: 10px; }
    .filter-group { width: 100%; min-width: auto; }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer { padding: 40px 0 20px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 20px 12px; }
    .stat-card .stat-number { font-size: 1.5rem; }

    .section-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .section-header h2 { font-size: 1.3rem; }

    .project-detail { padding: 90px 0 40px; }
    .project-hero { gap: 20px; }
    .project-gallery { aspect-ratio: 16/9; }
    .project-info-card { padding: 20px; }
    .project-info-card h1 { font-size: 1.2rem; }
    .price-tag { font-size: 1.5rem !important; }
    .info-list li { font-size: 0.85rem; padding: 10px 0; }

    .modal-content { padding: 20px; max-width: 95vw; border-radius: 16px; }
    .payment-tabs { flex-wrap: wrap; }
    .payment-tab { font-size: 0.78rem; padding: 10px 8px; flex: 1; min-width: 80px; }
    .bank-info { padding: 14px; }
    .bank-info-row { flex-direction: column; gap: 4px; padding: 8px 0; }

    .page-section { padding: 90px 0 40px; }
    .page-content h1, .gold-text[style*="2."] { font-size: 1.6rem !important; }

    .ads-slider img, .ad-item.ad-banner img { max-height: 200px; border-radius: var(--radius-md); }

    .preview-frame { height: 400px; }
    
    .glass-card { border-radius: var(--radius-md); }
    .glass-card:hover { transform: none; }

    .code-input-group { flex-direction: column; }
    .code-input-group input { text-align: center; }
}

/* ===== Responsive - Mobile (max-width: 480px) ===== */
@media (max-width: 480px) {
    html { font-size: 14px; }
    .container { padding: 0 10px; }

    .hero { padding: 80px 10px 40px; }
    .hero h1 { font-size: 1.5rem; line-height: 1.4; }
    .hero p { font-size: 0.88rem; margin-bottom: 24px; }

    .projects-grid { grid-template-columns: 1fr; gap: 14px; }
    .project-card .card-image { height: 180px; }
    .card-body { padding: 14px; }
    .card-footer { flex-direction: column; gap: 10px; align-items: stretch; }
    .card-footer .btn { width: 100%; text-align: center; }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 16px 10px; }
    .stat-card .stat-icon { width: 44px; height: 44px; font-size: 1.1rem; }
    .stat-card .stat-number { font-size: 1.3rem; }

    .project-info-card { padding: 16px; }
    .project-actions .btn { font-size: 0.88rem; padding: 12px; }

    .footer-grid { gap: 20px; }
    .footer-social { flex-wrap: wrap; }

    .modal-content { padding: 16px; }
    .modal-close { top: 10px; right: 10px; width: 32px; height: 32px; }

    .pagination a, .pagination span { width: 36px; height: 36px; font-size: 0.82rem; }

    .toast { left: 10px; right: 10px; bottom: 10px; }
    body[dir="rtl"] .toast { left: 10px; right: 10px; }

    .gallery-slider { aspect-ratio: 16/10; }
    .gallery-thumb { min-width: 60px; height: 44px; }

    .contact-info-card { flex-direction: column; text-align: center; }
    .contact-info-card .ci-icon { margin: 0 auto; }

    .nav-logo { gap: 8px; font-size: 1rem; }

    .ads-slider img, .ad-item.ad-banner img { max-height: 150px; }
}

/* ===== Responsive - Very Small (max-width: 360px) ===== */
@media (max-width: 360px) {
    html { font-size: 13px; }
    .hero h1 { font-size: 1.3rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .payment-tabs { flex-direction: column; }
    .payment-tab { width: 100%; }
}
