/* ========================================
   1rob tech - Modern Roblox Codes Website
   Professional Blue/Cyan Theme
   ======================================== */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Colors - Professional Blue/Cyan Theme */
    --primary: #00d4ff;
    --primary-dark: #00a8cc;
    --primary-light: #33ddff;
    --secondary: #6366f1;
    --secondary-dark: #4f46e5;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #6366f1 100%);
    --gradient-dark: linear-gradient(135deg, #0a1628 0%, #1a2942 100%);
    
    /* Background Colors */
    --bg-primary: #0a1628;
    --bg-secondary: #1a2942;
    --bg-card: #243447;
    --bg-hover: #2d3f54;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Border & Shadows */
    --border: #334155;
    --shadow-sm: 0 2px 8px rgba(0, 212, 255, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 212, 255, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 212, 255, 0.2);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

/* ========================================
   Adsterra Ad Containers
   ======================================== */

/* Banner Ads Container (728x90 desktop / 320x50 mobile) */
.ad-container-banner {
    width: 100%;
    max-width: 728px; /* حد أقصى للعرض */
    margin: 25px auto; /* توسيط */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
    overflow: hidden;
    padding: 0 15px; /* Padding للحواف */
}

.ad-container-banner iframe {
    max-width: 100%;
    height: auto;
}

/* Ad card for 300x250 ads between games */
.ad-card-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 15px;
    min-height: 250px;
    max-width: 300px; /* حد أقصى للعرض */
    margin: 0 auto; /* توسيط */
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    overflow: hidden;
}

.ad-card-item iframe {
    max-width: 100%;
    max-height: 100%;
}

/* Responsive adjustments for mobile screens */
@media (max-width: 768px) {
    .ad-container-banner {
        max-width: 320px; /* للموبايل */
        min-height: 50px;
        padding: 0 10px;
    }
    
    .ad-card-item {
        max-width: 100%;
        width: 100%;
        grid-column: 1 / -1; /* يمتد على كامل العرض في الشبكة */
    }
}

/* ========================================
   Light Mode Theme
   ======================================== */
[data-theme="light"] {
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Border & Shadows */
    --border: #e2e8f0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.2);
    
    /* Gradients للـ Light Mode */
    --gradient-dark: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(180deg);
}

.theme-toggle i {
    color: var(--primary);
    font-size: 1.125rem;
}

.theme-toggle:hover i {
    color: #ffffff;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 80px; /* Space for fixed navbar */
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* ========================================
   Container & Layout
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.text-center {
    text-align: center;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 10000;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) 0;
}

/* ========================================
   Navigation
   ======================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
    padding: 1rem 0;
}

.nav-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Animated Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 2px;
    position: relative;
}

.logo-icon {
    color: var(--primary);
    font-size: 2.2rem;
    animation: gamepadBounce 2s ease-in-out infinite;
}

.logo-text {
    display: flex;
    gap: 0.5rem;
}

.logo-part {
    display: inline-block;
    animation: textSlideIn 1s ease-out;
    text-transform: uppercase;
    font-weight: 900;
}

.logo-part:first-child {
    color: var(--text-primary);
    animation-delay: 0.1s;
}

.logo-part.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation-delay: 0.3s;
}

/* Logo Animations */
@keyframes gamepadBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(-5deg);
    }
    75% {
        transform: translateY(-5px) rotate(5deg);
    }
}

@keyframes textSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.logo:hover .logo-icon {
    animation: gamepadSpin 0.6s ease-in-out;
    color: #00ffff;
}

@keyframes gamepadSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.logo:hover .logo-part {
    animation: textGlow 0.5s ease-in-out;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: none;
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
    }
}

/* ========================================
   Main Content Spacing (for fixed navbar)
   ======================================== */
main,
section:first-of-type:not(.hero):not(.game-header):not(.page-header),
.page-content {
    padding-top: 100px;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    position: relative;
    padding: var(--spacing-2xl) 0;
    padding-top: 120px; /* Space for fixed navbar */
    min-height: 90vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 50px;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xl);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    flex-wrap: wrap;
}

.stat-card {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    min-width: 150px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4),
                0 0 20px rgba(79, 70, 229, 0.3);
    animation: btnGlow 1.5s ease-in-out infinite;
}

@keyframes btnGlow {
    0%, 100% { box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4), 0 0 20px rgba(79, 70, 229, 0.3); }
    50% { box-shadow: 0 8px 24px rgba(79, 70, 229, 0.6), 0 0 30px rgba(79, 70, 229, 0.5); }
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-show-all {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.btn-show-all:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Hero Background Animation
   ======================================== */
.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: blob 20s infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -250px;
    right: -250px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -200px;
    left: -200px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ========================================
   Section Styles
   ======================================== */
.games-section,
.how-it-works,
.all-games-section,
.codes-section {
    padding: var(--spacing-2xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.section-title i {
    color: var(--primary);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ========================================
   Filter Tabs
   ======================================== */
.filter-tabs {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-2xl);
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

/* ========================================
   Games Grid
   ======================================== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

.game-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(79, 70, 229, 0.05) 100%);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    animation: cardFloat 6s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(79, 70, 229, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.game-card:hover::before {
    opacity: 1;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.game-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.3),
                0 0 20px rgba(79, 70, 229, 0.2);
}

.game-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.game-card:hover .game-image img {
    transform: scale(1.1);
}

.game-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex: 1; /* يملأ المساحة المتبقية */
    min-height: 0; /* مهم لـ flexbox */
}

.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
    min-height: 2.6em; /* ارتفاع ثابت لسطرين */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-meta {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    flex-wrap: wrap;
    min-height: 1.5em; /* ارتفاع ثابت */
}

.game-meta i {
    color: var(--primary);
}

.game-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.625em; /* ارتفاع ثابت لسطرين */
    flex-grow: 1; /* يدفع الزر للأسفل */
}

.game-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-top: auto;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.game-btn:hover::after {
    width: 400px;
    height: 400px;
}

.game-btn:hover {
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5),
                0 0 30px rgba(79, 70, 229, 0.4);
    transform: translateY(-3px) scale(1.02);
}

/* ========================================
   How It Works Section
   ======================================== */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
}

.step-card {
    position: relative;
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.step-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 800;
    font-size: 1.25rem;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

.step-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: var(--spacing-md);
}

.step-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.step-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================
   Game Detail Page
   ======================================== */
.game-header {
    background: var(--bg-secondary);
    padding: var(--spacing-2xl) 0;
    padding-top: 120px; /* Space for fixed navbar */
    border-bottom: 1px solid var(--border);
}

.game-header-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.game-header-image {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
}

.game-header-info h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: var(--spacing-md);
}

.game-header-meta {
    display: flex;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.game-header-meta i {
    color: var(--primary);
}

.game-header-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   Codes Section
   ======================================== */
.codes-grid {
    display: grid;
    gap: var(--spacing-md);
}

.code-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    will-change: transform, opacity, filter;
}

.code-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.15), transparent);
    transition: left 0.6s;
}

.code-card:hover::before {
    left: 100%;
}

.code-card:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.25),
                0 0 20px rgba(139, 92, 246, 0.15);
    transform: translateY(-4px);
}

.code-info {
    flex: 1;
    min-width: 0;
}

.code-info h4 {
    font-size: 1.5rem;
    font-family: 'Courier New', monospace;
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
    word-break: break-all;
}

.code-reward {
    color: var(--text-secondary);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-reward i {
    color: var(--primary);
    margin-right: var(--spacing-xs);
}

.copy-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.copy-btn:hover {
    box-shadow: var(--shadow-glow);
}

.copy-btn.copied {
    background: #10b981;
}

.code-card.expired {
    opacity: 0.6;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, opacity, filter;
}

.code-card.expired .code-info h4 {
    text-decoration: line-through;
    color: var(--text-muted);
}

.code-card.expired .copy-btn {
    background: var(--bg-hover);
    cursor: not-allowed;
}

/* Expired Codes Grid */
#expiredCodesGrid {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

#expiredCodesGrid.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

#expiredCodesGrid:not(.hidden) {
    animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 2000px;
        opacity: 1;
    }
}

/* ========================================
   Show All Container
   ======================================== */
.show-all-container {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border);
}

#toggleExpired {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

#toggleExpired::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#toggleExpired:hover::before {
    width: 300px;
    height: 300px;
}

#toggleExpired:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5),
                0 0 30px rgba(79, 70, 229, 0.3);
}

#toggleExpired:active {
    transform: translateY(-1px) scale(1.02);
}

#toggleExpired i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

#toggleExpired.active i {
    transform: rotate(180deg);
}

/* ========================================
   Redeem Guide
   ======================================== */
.redeem-guide {
    padding: var(--spacing-xl) 0;
}

.guide-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 800px;
    margin: 0 auto;
}

.guide-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    color: var(--primary);
}

.guide-steps {
    padding-left: var(--spacing-xl);
}

.guide-steps li {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

/* ========================================
   Page Header
   ======================================== */
.page-header {
    background: var(--bg-secondary);
    padding: var(--spacing-2xl) 0;
    padding-top: 120px; /* Space for fixed navbar */
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: var(--spacing-md);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
    margin-top: var(--spacing-2xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
}

.footer-brand .logo {
    margin-bottom: var(--spacing-md);
}

.footer-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    max-width: 400px;
}

.social-links {
    display: flex;
    gap: var(--spacing-md);
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-xl);
}

.footer-column h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--primary);
}

.footer-column ul li {
    margin-bottom: var(--spacing-sm);
}

.footer-column ul li a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-column ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.disclaimer {
    margin-top: var(--spacing-sm);
    color: var(--text-muted);
}

.disclaimer i {
    color: var(--primary);
}

/* ========================================
   Toast Notification
   ======================================== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-secondary);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transform: translateY(150%);
    transition: transform 0.3s ease;
    z-index: 9999;
}

.toast.show {
    transform: translateY(0);
}

.toast i {
    color: var(--primary);
    font-size: 1.25rem;
}

/* ========================================
   Utility Classes
   ======================================== */
.hidden {
    display: none !important;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    color: #10b981;
    font-size: 0.875rem;
    font-weight: 600;
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 600;
    transition: var(--transition);
}

.toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.toggle-btn.active i {
    transform: rotate(180deg);
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .copy-btn,
    .game-btn,
    .filter-btn,
    .entry-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .mobile-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-links a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .logo-icon {
        font-size: 1.8rem;
    }
    
    .logo-text {
        gap: 0.3rem;
    }
    
    /* Mobile spacing for fixed navbar */
    body {
        padding-top: 70px;
    }
    
    main,
    section:first-of-type:not(.hero):not(.game-header):not(.page-header),
    .page-content {
        padding-top: 0;
    }
    
    .hero {
        padding-top: 90px !important;
        padding-bottom: 2rem !important;
        min-height: auto;
    }
    
    .game-header {
        padding-top: 90px !important;
    }
    
    .page-header {
        padding-top: 90px !important;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stat-card {
        min-width: auto;
    }
    
    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr); /* لعبتين في كل سطر */
        gap: 0.75rem;
    }
    
    .game-card {
        max-width: 100%;
    }
    
    /* تحسين الصورة */
    .game-image {
        height: 120px; /* أقصر */
    }
    
    /* تحسين المحتوى */
    .game-content {
        padding: 0.75rem;
    }
    
    .game-title {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
        line-height: 1.3;
        min-height: 2.34em; /* ارتفاع ثابت لسطرين */
    }
    
    .game-description {
        font-size: 0.75rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
        min-height: 1.95em; /* ارتفاع ثابت لسطرين */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .game-meta {
        font-size: 0.7rem;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
        min-height: 1.2em; /* ارتفاع ثابت */
    }
    
    .game-meta span {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
    
    .game-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .game-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .game-header {
        padding: 2rem 0;
    }
    
    .game-header-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .game-header-image {
        max-width: 100%;
        height: auto;
    }
    
    .game-header-info h1 {
        font-size: 1.75rem;
    }
    
    .game-header-meta {
        flex-wrap: wrap;
        gap: 0.75rem;
        font-size: 0.85rem;
    }
    
    .code-card {
        padding: var(--spacing-md);
        flex-direction: row;
    }
    
    .code-info {
        min-width: 0;
        flex: 1;
    }
    
    .code-info h4 {
        font-size: 1.125rem;
    }
    
    .code-reward {
        font-size: 0.85rem;
    }
    
    .copy-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.5rem;
    }
    
    .filter-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        white-space: nowrap;
    }
    
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        padding: 2rem 0;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .nav-content {
        padding: 0.5rem 0;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .logo i {
        font-size: 1.125rem;
    }
    
    .hero {
        padding: 3rem 0 1.5rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .game-card {
        border-radius: 0.75rem;
    }
    
    .game-title {
        font-size: 1.125rem;
    }
    
    .game-meta {
        font-size: 0.8rem;
    }
    
    .game-description {
        font-size: 0.85rem;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
    }
    
    .game-btn {
        font-size: 0.85rem;
        padding: 0.625rem 1rem;
    }
    
    .code-card {
        padding: 0.75rem;
        gap: 0.75rem;
        flex-direction: row; /* أفقي على الموبايل */
        align-items: center;
    }
    
    .code-info {
        flex: 1;
        min-width: 0;
    }
    
    .code-info h4 {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
        word-break: break-all;
    }
    
    .code-reward {
        font-size: 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .code-reward i {
        font-size: 0.7rem;
        flex-shrink: 0;
    }
    
    .copy-btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .filter-tabs {
        padding: 0 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.875rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .step-card {
        padding: 1.5rem 1rem;
    }
    
    .step-icon {
        font-size: 2rem;
    }
    
    .step-title {
        font-size: 1.125rem;
    }
    
    .step-description {
        font-size: 0.85rem;
    }
    
    .game-header-info h1 {
        font-size: 1.5rem;
    }
    
    .game-header-meta {
        font-size: 0.8rem;
        gap: 0.5rem;
    }
    
    .game-header-description {
        font-size: 0.9rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
    
    .guide-card {
        padding: 1.25rem;
    }
    
    .guide-card h3 {
        font-size: 1.25rem;
    }
    
    .guide-steps {
        padding-left: 1.25rem;
    }
    
    .guide-steps li {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-description {
        font-size: 0.85rem;
    }
    
    .social-links a {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .footer-column h4 {
        font-size: 0.9rem;
    }
    
    .footer-column ul li a {
        font-size: 0.85rem;
    }
    
    .footer-bottom {
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 0.85rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.85rem;
    }
    
    /* تحسين عرض الألعاب على الشاشات الصغيرة جداً */
    .games-grid {
        grid-template-columns: repeat(2, 1fr); /* لعبتين في كل سطر */
        gap: 0.5rem;
    }
    
    .game-card {
        border-radius: 0.5rem;
    }
    
    .game-image {
        height: 100px; /* أقصر للشاشات الصغيرة */
    }
    
    .game-content {
        padding: 0.5rem;
    }
    
    .game-title {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
        line-height: 1.2;
        min-height: 1.92em; /* ارتفاع ثابت لسطرين */
    }
    
    .game-meta {
        font-size: 0.65rem;
        gap: 0.35rem;
        margin-bottom: 0.4rem;
        min-height: 1em; /* ارتفاع ثابت */
    }
    
    .game-meta span {
        font-size: 0.65rem;
    }
    
    .game-meta i {
        font-size: 0.65rem;
    }
    
    .game-description {
        font-size: 0.7rem;
        line-height: 1.25;
        margin-bottom: 0.4rem;
        min-height: 1.75em; /* ارتفاع ثابت لسطرين */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .game-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.5rem;
    }
    
    .game-btn i {
        font-size: 0.7rem;
    }
    
    .game-badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }
    
    .code-card {
        padding: 0.625rem;
        gap: 0.5rem;
    }
    
    .code-info h4 {
        font-size: 0.9rem;
    }
    
    .code-reward {
        font-size: 0.75rem;
    }
    
    .copy-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }
    
    .copy-btn i {
        font-size: 0.85rem;
    }
    
    .filter-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    .section-title {
        font-size: 1.375rem;
    }
    
    .step-icon {
        font-size: 1.75rem;
    }
    
    .step-title {
        font-size: 1rem;
    }
    
    .step-description {
        font-size: 0.8rem;
    }
    
    .game-header-info h1 {
        font-size: 1.375rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .guide-card h3 {
        font-size: 1.125rem;
    }
    
    .guide-steps li {
        font-size: 0.8rem;
    }
    
    .toast {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
}

/* ========================================
   Loading Animation
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ========================================
   Lazy Loading Styles
   ======================================== */
img[data-src],
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loaded {
    opacity: 1;
}

/* ========================================
   Skeleton Loading Styles
   ======================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.skeleton-title {
    height: 24px;
    width: 80%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 16px;
    width: 60%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-button {
    height: 44px;
    width: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
    margin-top: auto;
}

/* Fade in when content loads */
.game-card.loaded {
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ad-container {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-container:not(.ad-loaded) {
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
}

.ad-loaded {
    animation: fadeIn 0.4s ease;
}

