/* ===========================
   ROOT VARIABLES
   =========================== */
:root {
    /* Colors */
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    /* Gradients */
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-5: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-premium: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.2);
    --shadow-colored: 0 10px 40px rgba(102, 126, 234, 0.3);
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-2xl: 64px;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-dark: #ffffff;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;
}

/* ===========================
   RESET & BASE
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    transition: var(--transition);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ===========================
   PARTICLES BACKGROUND
   =========================== */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

/* ===========================
   NAVIGATION
   =========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.98);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    gap: 32px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: var(--shadow-colored);
    transition: var(--transition);
}

.logo:hover .logo-icon {
    transform: rotate(360deg) scale(1.1);
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.logo-text span {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 15px;
    position: relative;
    padding: 8px 0;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-1);
    transition: var(--transition);
    border-radius: var(--radius-full);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 18px;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--gradient-1);
    color: white;
    transform: rotate(180deg);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    padding: 5px;
}

.mobile-toggle span {
    width: 100%;
    height: 3px;
    background: var(--text-primary);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ===========================
   HERO SECTION
   =========================== */
.hero {
    padding: 140px 0 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.15), transparent);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: float 20s infinite ease-in-out;
}

.hero::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.15), transparent);
    border-radius: 50%;
    bottom: -150px;
    left: -150px;
    animation: float 25s infinite ease-in-out reverse;
}

.hero .container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 24px;
    animation: pulse 2s infinite;
}

.hero-badge i {
    color: #fbbf24;
}

.hero-title {
    font-size: 56px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 24px;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-colored);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: var(--gradient-1);
    color: white;
}

.btn-white {
    background: white;
    color: var(--primary);
}

.btn-white:hover {
    transform: scale(1.05);
}

/* Hero Stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-box p {
    font-size: 13px;
    color: var(--text-light);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 500px;
}

.hero-mockup {
    position: relative;
    width: 100%;
    height: 100%;
}

.mockup-browser {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.browser-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.browser-dots {
    display: flex;
    gap: 6px;
}

.browser-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
}

.browser-dots span:nth-child(1) {
    background: #ef4444;
}

.browser-dots span:nth-child(2) {
    background: #fbbf24;
}

.browser-dots span:nth-child(3) {
    background: #22c55e;
}

.browser-url {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-light);
}

.browser-url i {
    color: #22c55e;
}

.browser-content {
    height: calc(100% - 60px);
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-placeholder {
    font-size: 120px;
    color: rgba(255, 255, 255, 0.3);
    animation: float 4s infinite ease-in-out;
}

/* Floating Cards */
.floating-card {
    position: absolute;
    background: white;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    animation: float 4s infinite ease-in-out;
}

.floating-card i {
    width: 40px;
    height: 40px;
    background: var(--gradient-1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.floating-card span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.card-1 {
    top: 20px;
    left: -30px;
}

.card-2 {
    top: 50%;
    right: -40px;
    transform: translateY(-50%);
    animation-delay: 1s;
}

.card-3 {
    bottom: 20px;
    left: -30px;
    animation-delay: 2s;
}

/* ===========================
   SECTION HEADER
   =========================== */
.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title {
    font-size: 48px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 16px;
}

.section-description {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===========================
   TEMPLATES SECTION
   =========================== */
.templates-section {
    padding: 100px 0;
    background: var(--bg-secondary);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: white;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 15px;
    color: var(--text-secondary);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--gradient-1);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-colored);
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 32px;
}

.template-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.template-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* Template Preview */
.template-preview {
    position: relative;
    overflow: hidden;
}

.template-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.template-mockup {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: white;
    font-size: 80px;
    transition: var(--transition);
}

.template-mockup span {
    font-size: 24px;
    font-weight: 700;
}

.template-card:hover .template-mockup {
    transform: scale(1.1);
}

.gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.gradient-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.gradient-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }

/* Preview Overlay */
.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.template-card:hover .preview-overlay {
    opacity: 1;
}

.overlay-content {
    display: flex;
    gap: 12px;
}

.preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    color: var(--text-primary);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.preview-btn:hover {
    background: var(--gradient-1);
    color: white;
    transform: scale(1.05);
}

.preview-btn.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.preview-btn.secondary:hover {
    background: white;
    color: var(--text-primary);
}

/* Template Badge */
.template-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    z-index: 10;
}

.badge-new {
    background: #22c55e;
    color: white;
}

.badge-popular {
    background: #f59e0b;
    color: white;
}

.badge-premium {
    background: var(--gradient-premium);
    color: white;
}

.badge-hot {
    background: #ef4444;
    color: white;
}

/* Template Info */
.template-info {
    padding: 24px;
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.template-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.template-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
    border-radius: var(--radius-full);
}

.template-rating i {
    color: #fbbf24;
    font-size: 14px;
}

.template-rating span {
    font-size: 14px;
    font-weight: 700;
    color: #f59e0b;
}

.template-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 15px;
}

/* Template Tags */
.template-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.tag i {
    font-size: 12px;
    color: var(--primary);
}

/* Template Footer */
.template-footer {
    padding-top: 20px;
    border-top: 2px solid var(--bg-secondary);
}

.template-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gradient-1);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    width: 100%;
    justify-content: center;
}

.template-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-colored);
}

/* ===========================
   FEATURES SECTION
   =========================== */
.features-section {
    padding: 100px 0;
    background: white;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.feature-card {
    text-align: center;
    padding: 40px 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    background: white;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    margin: 0 auto 24px;
    box-shadow: var(--shadow-colored);
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===========================
   STATS SECTION
   =========================== */
.stats-section {
    padding: 100px 0;
    background: var(--gradient-1);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: float 20s infinite ease-in-out;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    position: relative;
    z-index: 1;
}

.stats-card {
    text-align: center;
    padding: 40px 32px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.15);
}

.stats-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    margin: 0 auto 24px;
}

.stats-number {
    font-size: 48px;
    font-weight: 900;
    color: white;
    line-height: 1;
    margin-bottom: 12px;
}

.stats-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    font-weight: 600;
}

/* ===========================
   CTA SECTION
   =========================== */
.cta-section {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.cta-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 60px 80px;
    background: var(--gradient-1);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.cta-text h2 {
    font-size: 42px;
    font-weight: 900;
    color: white;
    margin-bottom: 12px;
}

.cta-text p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
}

/* ===========================
   FOOTER
   =========================== */
.footer {
    background: var(--bg-darker);
    color: white;
    padding: 80px 0 32px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-brand {
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-top: 12px;
}

.footer-links h4,
.footer-social h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-right: 8px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--gradient-1);
    transform: translateY(-4px);
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
}

/* ===========================
   BACK TO TOP
   =========================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-colored);
    cursor: pointer;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    display: flex;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

/* ===========================
   MODAL
   =========================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-primary);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gradient-1);
    color: white;
    transform: rotate(90deg);
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 1200px) {
    .hero .container {
        grid-template-columns: 1fr;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 992px) {
    .hero-title {
        font-size: 42px;
    }
    
    .section-title {
        font-size: 36px;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .cta-content {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 82px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 82px);
        background: white;
        flex-direction: column;
        padding: 40px 20px;
        box-shadow: var(--shadow-lg);
        transition: var(--transition);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cta-content {
        padding: 40px 32px;
    }
    
    .cta-text h2 {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 120px 0 80px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-description {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stat-box {
        flex-direction: column;
        text-align: center;
    }
}
/* ===========================  
   MODAL STYLES  
   =========================== */  
.modal-template {  
    animation: modalSlideUp 0.4s ease;  
}  

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

.modal-header-content {  
    display: flex;  
    justify-content: space-between;  
    align-items: center;  
    margin-bottom: 20px;  
    padding-bottom: 20px;  
    border-bottom: 2px solid var(--bg-secondary);  
}  

.modal-header-content h2 {  
    font-size: 32px;  
    font-weight: 800;  
    color: var(--text-primary);  
}  

.modal-rating {  
    display: flex;  
    align-items: center;  
    gap: 6px;  
    padding: 8px 16px;  
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));  
    border-radius: var(--radius-full);  
}  

.modal-rating i {  
    color: #fbbf24;  
    font-size: 18px;  
}  

.modal-rating span {  
    font-size: 18px;  
    font-weight: 700;  
    color: #f59e0b;  
}  

.modal-tags {  
    display: flex;  
    gap: 12px;  
    margin-bottom: 24px;  
}  

.modal-tag {  
    display: inline-flex;  
    align-items: center;  
    gap: 8px;  
    padding: 8px 16px;  
    background: var(--bg-secondary);  
    border-radius: var(--radius-full);  
    font-size: 14px;  
    font-weight: 600;  
    color: var(--text-secondary);  
}  

.modal-tag i {  
    color: var(--primary);  
}  

.modal-description {  
    font-size: 16px;  
    color: var(--text-secondary);  
    line-height: 1.8;  
    margin-bottom: 32px;  
}  

.modal-section {  
    margin-bottom: 32px;  
}  

.modal-section h3 {  
    display: flex;  
    align-items: center;  
    gap: 10px;  
    font-size: 20px;  
    font-weight: 700;  
    color: var(--text-primary);  
    margin-bottom: 16px;  
}  

.modal-section h3 i {  
    color: var(--primary);  
}  

.modal-features {  
    display: grid;  
    grid-template-columns: repeat(2, 1fr);  
    gap: 12px;  
}  

.modal-features li {  
    display: flex;  
    align-items: center;  
    gap: 10px;  
    padding: 12px;  
    background: var(--bg-secondary);  
    border-radius: var(--radius-md);  
    font-size: 15px;  
    color: var(--text-secondary);  
}  

.modal-features li i {  
    color: var(--success);  
    font-size: 14px;  
}  

.modal-technologies {  
    display: flex;  
    flex-wrap: wrap;  
    gap: 10px;  
}  

.tech-badge {  
    padding: 8px 16px;  
    background: var(--gradient-1);  
    color: white;  
    border-radius: var(--radius-md);  
    font-size: 13px;  
    font-weight: 600;  
}  

.modal-actions {  
    display: flex;  
    gap: 12px;  
    margin-top: 32
   /* استكمال من السطر السابق */

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid var(--bg-secondary);
}

.modal-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    text-align: center;
}

.modal-btn.primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-colored);
}

.modal-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.modal-btn.secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.modal-btn.secondary:hover {
    background: var(--primary);
    color: white;
}

/* ===========================
   NOTIFICATION SYSTEM
   =========================== */
.notification {
    position: fixed;
    top: 100px;
    right: -400px;
    background: white;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    z-index: 10000;
    transition: var(--transition);
}

.notification.show {
    right: 30px;
}

.notification i {
    font-size: 24px;
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.success i {
    color: var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.error i {
    color: var(--danger);
}

.notification span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

/* ===========================
   PRELOADER
   =========================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease;
}

.preloader-content {
    text-align: center;
}

.preloader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-secondary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.preloader-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===========================
   RESPONSIVE MODAL
   =========================== */
@media (max-width: 768px) {
    .modal-content {
        padding: 32px 24px;
        max-height: 95vh;
    }
    
    .modal-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .modal-header-content h2 {
        font-size: 24px;
    }
    
    .modal-features {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
    
    .notification {
        min-width: auto;
        right: -100%;
        left: 20px;
        right: 20px;
    }
    
    .notification.show {
        right: 20px;
    }
}

/* ===========================
   CUSTOM SCROLLBAR
   =========================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gradient-1);
    border-radius: var(--radius-full);
}

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

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-secondary);
}

/* ===========================
   SELECTION COLOR
   =========================== */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
    .navbar,
    .back-to-top,
    .notification,
    .modal {
        display: none !important;
    }
    
    body {
        background: white;
    }
}
/* Template Image Styles */
.template-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-secondary);
}

.template-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: var(--transition);
}

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

/* Loading placeholder for images */
.template-image img[loading="lazy"] {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        #e2e8f0 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* Image error handling */
.template-image img[src=""],
.template-image img:not([src]) {
    display: none;
}

.template-image img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Overlay on image */
.template-preview::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.template-card:hover .template-preview::after {
    opacity: 1;
}
/* Modal Banner Image */
.modal-banner {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.modal-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: var(--transition);
}

.modal-banner:hover img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .modal-banner {
        height: 200px;
    }
}
