/* ============= CSS VARIABLES ============= */
:root {
    /* Primary Colors */
    --primary-color: #2563eb;
    --primary-hover: #1e40af;
    --secondary-color: #7c3aed;
    --accent-color: #f59e0b;

    /* Background Colors */
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --card-bg-light: #ffffff;
    --card-bg-dark: #1e293b;

    /* Text Colors */
    --text-primary-light: #1e293b;
    --text-primary-dark: #f1f5f9;
    --text-secondary-light: #64748b;
    --text-secondary-dark: #94a3b8;

    /* Utility Colors */
    --success-color: #10b981;
    --border-color-light: #e2e8f0;
    --border-color-dark: #334155;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.2);

    /* Active Theme Variables */
    --card-bg: var(--card-bg-light);
    --text-primary: var(--text-primary-light);
    --text-secondary: var(--text-secondary-light);
    --border-color: var(--border-color-light);
    --bg: var(--bg-light);
}

/* ============= RESET & BASE ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
}

*:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============= HEADER ============= */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--card-bg);
    box-shadow: 0 2px 10px var(--shadow);
    padding: 1rem 2rem;
    transition: background 0.3s ease;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.header-tools {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-btn,
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.5rem;
}

.search-btn:hover,
.theme-toggle:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============= HERO SECTION ============= */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 2rem;
    text-align: center;
    color: white;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.hero h1 {
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.hero-search {
    position: relative;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-search input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.5rem;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    font-family: inherit;
}

.hero-search i {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary-light);
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    padding: 0.8rem 2rem;
    border: 2px solid white;
    background: transparent;
    color: white;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ============= FILTER BUTTONS ============= */
.filter-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 0;
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ============= FEATURED SITES ============= */
.featured-sites {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

/* ============= CARDS ============= */
.site-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    will-change: transform;
}

.site-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow-hover);
}

.site-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.featured-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.site-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.rating-value {
    font-weight: 700;
    color: var(--text-primary);
}

.site-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.features-list {
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.feature-item i {
    color: var(--success-color);
}

.bonus-box {
    background: #fef3c7;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    border-right: 4px solid var(--accent-color);
    position: relative;
}

.bonus-title {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.bonus-details {
    font-size: 0.9rem;
    color: var(--text-secondary-light);
}

.bonus-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
}

.payment-methods {
    margin: 1rem 0;
}

.payment-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.payment-icons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.payment-icon {
    padding: 0.3rem 0.8rem;
    background: var(--bg);
    border-radius: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.visit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.visit-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

/* ============= NO RESULTS ============= */
.no-results {
    display: none;
    text-align: center;
    padding: 3rem;
}

.no-results i {
    font-size: 3rem;
    color: var(--text-secondary);
}

.no-results p {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* ============= MODAL ============= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: var(--bg);
}

.modal-content h2 {
    margin-bottom: 2rem;
    text-align: center;
}

.comparison-table {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.comparison-row {
    display: contents;
}

.comparison-cell {
    background: var(--card-bg);
    padding: 1rem;
    text-align: center;
}

.header-row .comparison-cell {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
}

.comparison-cell:first-child {
    text-align: right;
    font-weight: 600;
    background: var(--bg);
}

.header-row .comparison-cell:first-child {
    background: var(--primary-hover);
}

/* ============= FOOTER ============= */
footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-text {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    opacity: 0.8;
    transition: all 0.3s ease;
    display: block;
    padding: 0.5rem 0;
}

.footer-links a:hover {
    opacity: 1;
    padding-right: 5px;
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #94a3b8;
}

.social-icon:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    color: white;
}

.footer-bottom {
    text-align: center;
    padding: 2rem 0 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ============= BACK TO TOP ============= */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px var(--shadow);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
}

/* ============= ANIMATIONS ============= */
.fade-out {
    opacity: 0;
    transform: translateY(20px);
}

.fade-in {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============= DARK THEME ============= */
body.dark-theme {
    --card-bg: var(--card-bg-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --border-color: var(--border-color-dark);
    --bg: var(--bg-dark);
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        background: var(--card-bg);
        flex-direction: column;
        padding: 5rem 2rem;
        transition: 0.3s ease;
        box-shadow: -5px 0 20px var(--shadow);
        align-items: flex-start;
    }

    .nav-links.active {
        right: 0;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .sites-grid {
        grid-template-columns: 1fr;
    }

    .comparison-table {
        grid-template-columns: 1fr;
    }

    .comparison-row {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
        margin-bottom: 1rem;
        border-radius: 10px;
        overflow: hidden;
    }

    .header-container {
        padding: 0;
    }

    header {
        padding: 1rem;
    }

    .featured-sites {
        padding: 2rem 1rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    header {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 640px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .cta-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    .site-card {
        padding: 1.5rem;
    }

    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}
