/* الألوان الأساسية المستوحاة من الشعار KARTK */
:root {
    --color-dark-blue: #000000;
    --color-teal: #158b88;
    --color-magenta: #c22769;
    --color-orange: #e88024;
    --color-yellow: #f2b33e;
    
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --text-dark: #333333;
    --text-muted: #666666;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ---------------- تخصيص شريط التمرير (Scrollbar) ---------------- */
::-webkit-scrollbar {
    width: 12px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--color-magenta), var(--color-orange)); 
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--color-orange), var(--color-magenta)); 
}

/* ---------------- شريط التقدم العلوي (Scroll Progress) ---------------- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, var(--color-magenta), var(--color-orange), var(--color-yellow));
    z-index: 10001; 
    transition: width 0.1s ease;
    border-radius: 0 3px 3px 0;
}
body[dir="rtl"] #scroll-progress {
    left: auto;
    right: 0;
    border-radius: 3px 0 0 3px;
    background: linear-gradient(to left, var(--color-magenta), var(--color-orange), var(--color-yellow));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* الخطوط للعربي والكوردي (Amiri للنصوص العادية) وإيقاف التحديد للحماية */
body {
    font-family: 'Amiri', serif;
    color: var(--text-dark);
    background-color: var(--bg-white);
    overflow-x: hidden;
    transition: var(--transition);
    
    /* منع تحديد النصوص للحماية */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Standard */
}

/* الخط للعناوين وأزرار القائمة في العربي والكوردي (Aref Ruqaa) */
body:not([data-lang="en"]) h1, 
body:not([data-lang="en"]) h2, 
body:not([data-lang="en"]) h3, 
body:not([data-lang="en"]) .nav-item {
    font-family: 'Aref Ruqaa', serif;
}

/* الخط للغة الإنجليزية (Outfit) */
body[data-lang="en"] {
    font-family: 'Outfit', sans-serif;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---------------- المينيو (Navbar) ---------------- */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0);
    z-index: 1000;
    transition: var(--transition);
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    padding: 10px 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo img {
    height: 50px;
    transition: var(--transition);
}

#navbar.scrolled .logo img {
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 15px; 
}

/* تصميم المينيو الذكي (Scrollspy Active) */
.nav-item {
    font-weight: 700;
    font-size: 16px;
    color: var(--color-dark-blue);
    text-transform: uppercase;
    position: relative;
    padding: 8px 18px;
    border-radius: 25px;
    transition: var(--transition);
}

#navbar:not(.scrolled) .nav-item {
    color: #fff;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.nav-item::after { display: none; }

.nav-item:hover {
    background: rgba(19, 56, 99, 0.05);
}
#navbar:not(.scrolled) .nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* خلفية القسم النشط (المينيو الذكي) */
.nav-item.active-link {
    background: rgba(194, 39, 105, 0.1);
    color: var(--color-magenta) !important;
}
#navbar:not(.scrolled) .nav-item.active-link {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
    text-shadow: none;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    color: var(--color-dark-blue);
    cursor: pointer;
}
#navbar:not(.scrolled) .menu-toggle { color: #fff; }

/* ---------------- قسم البداية (Hero Section) ---------------- */
.hero-section {
    position: relative;
    height: 100vh;
    width: 100%;
    background: #000000; 
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#particles-js {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    pointer-events: none; 
}

.hero-logo {
    max-width: 800px;
    width: 80%;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
    animation: floatingLogo 4s ease-in-out infinite;
}

@keyframes floatingLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* ---------------- تصميم الأقسام (Sections) ---------------- */
.section { padding: 100px 20px; }
.bg-light { background-color: var(--bg-light); }

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 36px;
    color: var(--color-dark-blue);
    font-weight: 900;
    margin-bottom: 10px;
}

.title-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--color-teal), var(--color-magenta));
    margin: 0 auto;
    border-radius: 5px;
}

/* ---------------- من نحن (About) ---------------- */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 20px;
    line-height: 1.8;
    color: var(--text-muted);
}
.about-content strong { color: var(--color-magenta); }

/* ---------------- خدماتنا (Services) ---------------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: var(--transition);
    border-bottom: 4px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    border-bottom-color: var(--color-teal);
}

.service-icon {
    font-size: 50px;
    background: linear-gradient(45deg, var(--color-orange), var(--color-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 24px;
    color: var(--color-dark-blue);
    margin-bottom: 15px;
}

.service-card p {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ---------------- قوالب الزفاف (Templates) ---------------- */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 قوالب في كل صف للشاشات الكبيرة */
    gap: 30px;
}

.template-card {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: var(--transition);
    border-bottom: 4px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.template-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    border-bottom-color: var(--color-magenta);
}

.template-img-box {
    width: 100%;
    height: 300px; /* ارتفاع متناسق للصور */
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.template-img-box a {
    display: block;
    width: 100%;
    height: 100%;
}

.template-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* أنيميشن الصورة عند المرور (Hover) */
.template-card:hover .template-img-box img {
    transform: scale(1.08);
}

.template-card h3 {
    font-size: 20px;
    color: var(--color-dark-blue);
    margin-bottom: 20px;
    font-weight: 700;
    transition: var(--transition);
}

.template-card h3:hover {
    color: var(--color-magenta);
}

.template-btn {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(135deg, var(--color-magenta), var(--color-orange));
    color: #fff;
    border-radius: 25px;
    font-weight: bold;
    font-size: 14px;
    transition: var(--transition);
    margin-top: auto;
}

.template-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(194, 39, 105, 0.4);
    color: #fff;
}

/* تجاوب القوالب للشاشات المتوسطة والصغيرة */
@media screen and (max-width: 992px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 قوالب في الشاشات المتوسطة */
    }
}
@media screen and (max-width: 576px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr); /* تم التعديل ليصبح صفين في كل سطر في الهواتف */
        gap: 15px; /* تقليل المسافات لتناسب الشاشة الصغيرة */
    }
    
    .template-card {
        padding: 15px 10px; /* تقليل الحشوة للهاتف */
    }
    
    .template-img-box {
        height: 200px; /* تقليل ارتفاع الصورة لتناسب عمودين في الهاتف */
        margin-bottom: 15px;
    }
    
    .template-card h3 {
        font-size: 16px; /* تصغير حجم الخط للهاتف */
        margin-bottom: 15px;
    }
    
    .template-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
}

/* ---------------- اتصل بنا (Contact) ---------------- */
.contact-wrapper {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-intro {
    font-size: 22px;
    color: var(--color-dark-blue);
    margin-bottom: 40px;
    font-weight: 700;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.icon-box {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-teal), var(--color-dark-blue));
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    box-shadow: 0 10px 20px rgba(21, 139, 136, 0.3);
}

.contact-text a {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 5px;
    transition: var(--transition);
}
.contact-text a:hover { color: var(--color-magenta); }

/* ---------------- الفوتر (Footer) ---------------- */
footer {
    background: var(--color-dark-blue);
    color: #fff;
    padding: 50px 20px 30px;
    text-align: center;
}

.footer-logo {
    max-width: 150px;
    margin-bottom: 20px;
}

.copyright {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 10px;
}

.developed-by {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
}

.developed-by a {
    color: var(--color-yellow);
    font-weight: bold;
    letter-spacing: 1px;
}
.developed-by a:hover { color: #fff; }

/* ---------------- الأزرار العائمة (اللغات + الصعود) ---------------- */
.floating-btn {
    position: fixed;
    bottom: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.right-btn {
    right: 30px;
    background: var(--color-dark-blue);
    opacity: 0;
    visibility: hidden;
}
.right-btn.show { opacity: 1; visibility: visible; }
.right-btn:hover { background: var(--color-teal); transform: translateY(-5px); }

/* زر اللغات (ثابت دائماً على اليسار) */
.lang-switcher-wrapper {
    position: fixed;
    bottom: 30px;
    left: 30px; 
    z-index: 999;
}

.left-btn {
    position: relative;
    background: linear-gradient(135deg, var(--color-magenta), var(--color-orange));
    left: 0; bottom: 0;
}
.left-btn:hover { transform: scale(1.1); box-shadow: 0 8px 25px rgba(194, 39, 105, 0.4); }

/* قائمة اللغات بشكل قوس دائري (من الأعلى إلى اليمين) */
.lang-menu {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 50px;
    pointer-events: none;
}

.lang-btn-sub {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--color-dark-blue);
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lang-switcher-wrapper.open .lang-menu { pointer-events: auto; }

.lang-switcher-wrapper.open .lang-btn-sub:nth-child(1) { 
    opacity: 1; 
    transform: translate(0, -65px) scale(1);
    transition-delay: 0.05s; 
}
.lang-switcher-wrapper.open .lang-btn-sub:nth-child(2) { 
    opacity: 1; 
    transform: translate(50px, -50px) scale(1);
    transition-delay: 0.15s; 
}
.lang-switcher-wrapper.open .lang-btn-sub:nth-child(3) { 
    opacity: 1; 
    transform: translate(65px, 0) scale(1);
    transition-delay: 0.25s; 
}

.lang-btn-sub:hover { background: var(--color-teal); color: #fff; }

.hidden { display: none !important; }

/* ---------------- الموبايل (Fullscreen Circular Reveal Menu) ---------------- */
@media screen and (max-width: 768px) {
    
    .logo {
        position: relative;
        z-index: 1001;
    }

    .menu-toggle { 
        display: block; 
        position: relative;
        z-index: 1005 !important; 
        transition: transform 0.4s ease;
    }
    
    .menu-toggle.active {
        transform: rotate(90deg);
    }
    
    .menu-toggle.active i::before {
        content: "\f00d" !important; 
    }
    
    #navbar .menu-toggle.active {
        color: #fff !important; 
    }

    .nav-links {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: linear-gradient(135deg, var(--color-magenta), var(--color-orange), var(--color-teal), var(--color-dark-blue)) !important;
        background-size: 400% 400% !important;
        animation: vibrantMenuBG 12s ease infinite !important;
        
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important; 
        
        gap: 25px !important;
        z-index: 1002 !important; 
        
        clip-path: circle(0px at calc(100% - 50px) 50px);
        transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1) !important;
        opacity: 0;
        pointer-events: none;
    }

    body[dir="rtl"] .nav-links {
        clip-path: circle(0px at 50px 50px);
    }
    body[dir="ltr"] .nav-links {
        clip-path: circle(0px at calc(100% - 50px) 50px);
    }

    body[dir="rtl"] .nav-links.active {
        clip-path: circle(150% at 50px 50px) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    body[dir="ltr"] .nav-links.active {
        clip-path: circle(150% at calc(100% - 50px) 50px) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    @keyframes vibrantMenuBG {
        0% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }

    .nav-links li {
        opacity: 0;
        width: 100% !important; 
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        transform: translateY(30px);
        transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-links.active li:nth-child(1) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.3s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.4s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.5s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.6s; } 

    .nav-item {
        display: inline-block !important;
        width: auto !important; 
        padding: 12px 30px !important;
        margin: 0 auto !important; 
        font-size: 26px !important;
        color: #ffffff !important;
        text-shadow: 2px 2px 15px rgba(0,0,0,0.5) !important;
        text-align: center !important;
        border-radius: 20px !important;
        background: transparent;
    }
    
    .nav-item.active-link {
        background: rgba(255, 255, 255, 0.25) !important;
        color: #fff !important;
        box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    }
    
    .logo img { height: 35px; }
    #navbar.scrolled .logo img { height: 30px; }
    .hero-logo { width: 55%; max-width: 220px; }
    .footer-logo { max-width: 110px; }
    .section { padding: 60px 20px; }
}