/* --- المتغيرات والتنسيقات الأساسية --- */
:root {
    /* مشترك */
    --primary: #e80038;
    --primary-gradient-start: #9a0a2d;
    --primary-gradient-end: #e40e42;
    --font-cairo: 'Cairo', sans-serif;

    /* وضع الفاتح (الافتراضي) */
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.9);
    --text-main: #2d2d2d;
    --text-gray: #686868;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --tag-bg: rgba(232, 0, 56, 0.1);
}

[data-theme="dark"] {
    /* وضع الداكن */
    --bg-body: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-header: rgba(15, 15, 15, 0.9);
    --text-main: #ffffff;
    --text-gray: #b0b0b0;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.2);
    --tag-bg: rgba(232, 0, 56, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-cairo);
}

body {
    background-color: var(--bg-body);
    color: var(--text-gray);
    overflow-x: hidden;
    direction: rtl;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    transition: 0.3s;
    color: var(--primary);
}

/* --- الهيدر (المُحسن) --- */
header {
    background: var(--bg-header);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
}

.logo img {
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 600;
    font-size: 15px;
}

.nav-links a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: rotate(15deg);
    color: var(--primary);
}

.header-btn {
    background: linear-gradient(to right, var(--primary-gradient-start), var(--primary-gradient-end));
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 5px 15px rgba(232, 0, 56, 0.3);
}

.header-btn:hover {
    transform: translateY(-2px);
}

/* --- تنسيقات المحتوى الرئيسي --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Flex Hero */
.flex-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 80px;
    text-align: right;
    gap: 40px;
    padding-top: 20px;
}

.flex-item-left {
    flex: 1;
    text-align: center;
}

.flex-item-right {
    flex: 1;
}

.front-img {
    max-width: 320px;
    width: 100%;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.25));
    transition: transform 0.3s;
}

.front-img:hover {
    transform: translateY(-5px);
}

.klaster-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.2;
}

.klaster-snippet {
    font-size: 16px;
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 30px;
}

/* الأزرار العائمة */
.klaster-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #fff !important;
    border-radius: 50px;
    padding: 12px 35px;
    background-image: linear-gradient(to top right, var(--primary-gradient-start), var(--primary-gradient-end));
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(232, 0, 56, 0.25);
    margin-left: 10px;
    transition: all 0.3s;
}

.klaster-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(232, 0, 56, 0.4);
}

.klaster-size {
    display: inline-block;
    padding: 10px 18px;
    background-color: var(--tag-bg);
    color: var(--primary);
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
}

/* --- شريط الصور (Carousel) --- */
.screenshots-section {
    margin-bottom: 80px;
}

.carousel {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 20px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.carousel::-webkit-scrollbar {
    height: 8px;
}

.carousel::-webkit-scrollbar-track {
    background: transparent;
}

.carousel::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.ick {
    height: 350px;
    border-radius: 16px;
    flex-shrink: 0;
    transition: transform 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ick:hover {
    transform: scale(1.02);
}

/* --- المميزات (Cards) --- */
.section-header-title {
    text-align: right;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header-title::before {
    content: '';
    display: block;
    width: 5px;
    height: 30px;
    background: var(--primary);
    border-radius: 3px;
}

.features-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 80px;
    text-align: right;
}

.card {
    background-color: var(--bg-card);
    box-shadow: var(--shadow-soft);
    padding: 35px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-7px);
    border-color: var(--primary);
}

.features-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-main);
}

.features-info {
    color: var(--text-gray);
    font-size: 15px;
    margin-bottom: 25px;
    line-height: 1.7;
}

.features-tag {
    display: inline-block;
    background-color: var(--tag-bg);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
}

/* --- تذييل الصفحة --- */
footer {
    background: var(--bg-card);
    text-align: center;
    padding: 40px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

footer a {
    color: var(--text-gray);
    margin: 0 10px;
}

footer a:hover {
    color: var(--primary);
}

/* --- Responsive --- */
@media (max-width: 800px) {
    .nav-links {
        display: none;
        /* Mobile menu can be added later */
    }

    .flex-container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        margin-bottom: 60px;
    }

    .flex-item-left {
        margin-bottom: 20px;
    }

    .klaster-title {
        font-size: 2.2rem;
    }

    .klaster-title,
    .klaster-snippet,
    .section-header-title {
        text-align: center;
        justify-content: center;
    }

    .section-header-title::before {
        display: none;
    }

    .klaster-action {
        width: 100%;
        justify-content: center;
        margin: 5px 0;
    }

    .klaster-size {
        display: block;
        margin: 10px auto;
        width: fit-content;
    }

    .features-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* --- Lightbox / عارض الصور --- */
.lightbox {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
    transition: transform 0.1s ease-out;
    /* Smooth zoom/pan */
    cursor: grab;
}

.lightbox-content:active {
    cursor: grabbing;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

.ick {
    cursor: pointer;
    /* Clickable cursor for images */
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- الأسئلة الشائعة --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto 80px;
    text-align: right;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
    border-radius: 12px;
    padding: 0 25px;
    transition: 0.3s;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.faq-item:hover {
    transform: translateY(-2px);
}

.faq-item.active {
    border-color: var(--primary);
}

.faq-question {
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    color: var(--text-main);
    font-size: 16px;
}

.faq-question i {
    transition: transform 0.3s;
    color: var(--text-gray);
    font-size: 14px;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s;
    color: var(--text-gray);
    font-size: 14px;
    line-height: 1.7;
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding-bottom: 20px;
    opacity: 1;
    border-top: 1px solid var(--border-color);
    margin-top: -5px;
    padding-top: 15px;
}

/* --- صفحات السياسة والشروط --- */
.privacy-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.privacy-container h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 10px;
}

.privacy-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.privacy-section h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 15px;
}

.privacy-section p,
.privacy-section li {
    font-size: 16px;
    color: var(--text-gray);
    line-height: 1.8;
}

.privacy-section ul {
    margin-right: 20px;
    margin-top: 10px;
}

.privacy-section li {
    margin-bottom: 10px;
}