/* =========================================
   Base & Variables
   ========================================= */
:root {
    --primary-color: #0A2540;
    --primary-hover: #11365A;
    --accent-gradient: linear-gradient(135deg, #00C6FF, #0072FF);
    --whatsapp-green: #25D366;
    --whatsapp-hover: #1EBE55;
    
    --bg-main: #F4F7FC;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-solid: rgba(255, 255, 255, 0.95);
    
    --text-dark: #1F2937;
    --text-light: #4B5563;
    
    --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 50px -15px rgba(0,114,255,0.2);
    --border-glass: 1px solid rgba(255,255,255,0.4);
    
    --transition-fast: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-slow: 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 40% 20%, hsla(228,100%,74%,0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189,100%,56%,0.15) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(355,100%,93%,0.1) 0px, transparent 50%);
    color: var(--text-dark);
    line-height: 1.8;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #0072FF; }

a { text-decoration: none; color: inherit; transition: var(--transition-fast); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; border-radius: 8px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }

/* =========================================
   Typography & Gradients
   ========================================= */
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.gradient-text-light {
    background: linear-gradient(135deg, #fff, #e0f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* =========================================
   Glassmorphism Utilities
   ========================================= */
.glass-header {
    background: var(--bg-glass-solid);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: var(--border-glass);
}
.glass-card {
    background: var(--bg-glass-solid);
    border: var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

/* =========================================
   Animations & Hover Effects
   ========================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.hover-lift { transition: var(--transition-slow); }
.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.hover-glow { transition: var(--transition-fast); }
.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 114, 255, 0.4);
    transform: scale(1.02);
}

.shine-effect {
    position: relative;
    overflow: hidden;
}
.shine-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255,255,255,0.4);
    transform: rotate(30deg);
    transition: 0.5s;
}
.shine-effect:hover::after { left: 120%; }

/* =========================================
   Buttons
   ========================================= */
.btn-primary {
    background: var(--accent-gradient);
    color: #fff !important;
    padding: 12px 30px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 800;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
}
.btn-secondary {
    background: rgba(10, 37, 64, 0.1);
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 800;
    font-size: 1.1rem;
    border: 1px solid rgba(10, 37, 64, 0.2);
    transition: var(--transition-fast);
}
.btn-secondary:hover {
    background: rgba(10, 37, 64, 0.2);
}

.btn-whatsapp-large {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff !important;
    padding: 16px 40px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
}

/* =========================================
   Header & Navigation
   ========================================= */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition-fast);
    background: var(--primary-color); /* بداية الموقع مثل نهايته */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 55px; /* تم تصغير الهيدر ليكون أنيقاً جداً */
    flex-direction: row-reverse;
}

.logo {
    font-size: 2rem; /* تصغير اللوجو قليلاً ليتناسب مع الهيدر الجديد */
    font-weight: 900;
    color: #fff; /* أبيض ليتناسب مع الخلفية الغامقة */
    letter-spacing: -1px;
}
.logo span { color: #00C6FF; } /* لون فاتح متدرج */

.nav-links {
    display: flex;
    gap: 35px;
    align-items: center;
}
.nav-link {
    font-weight: 700;
    color: #E2E8F0; /* أبيض رمادي ليتناسب مع الخلفية الغامقة */
    font-size: 1.05rem;
    position: relative;
}
.nav-link:hover { color: #fff; }
.nav-link::after {
    content: '';
    position: absolute;
    width: 0; height: 3px;
    bottom: -6px; right: 0;
    background: var(--accent-gradient);
    transition: var(--transition-fast);
    border-radius: 3px;
}
.nav-link:hover::after { width: 100%; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    padding: 5px;
}
.mobile-menu-btn span {
    display: block;
    width: 30px; height: 3px;
    background: var(--accent-gradient);
    transition: var(--transition-fast);
    border-radius: 3px;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    position: relative;
    padding: 100px 0 80px;
    text-align: center;
    color: #fff;
    background: url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    min-height: 80vh;
    display: flex;
    align-items: center;
}
.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* تدرج دائري ذكي: أفتح في المنتصف ليظهر شغلك، وغامق في الأطراف ليعطي فخامة ويبرز النص */
    background: radial-gradient(circle at center, rgba(10,37,64,0.6) 0%, rgba(0,0,0,0.85) 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}
.hero-title {
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    margin-bottom: 20px;
    font-weight: 900;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.hero-desc {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: 35px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
    color: #E2E8F0;
    text-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================
   Grid & Cards (Services)
   ========================================= */
.section-title {
    text-align: center;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    margin-bottom: 50px;
    color: var(--primary-color);
    font-weight: 900;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
}

.services { padding: 100px 0; }

.card {
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    background: var(--bg-main);
    width: 80px; height: 80px;
    line-height: 80px;
    border-radius: 50%;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}
.card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.6rem;
    font-weight: 800;
}
.card p {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* =========================================
   Articles Grid
   ========================================= */
.latest-articles { padding: 100px 0; }

.article-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}
.article-img-wrapper {
    position: relative;
    overflow: hidden;
}
.article-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    transition: transform 0.8s ease;
}
.article-card:hover .article-img { transform: scale(1.05); }

.article-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.article-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    line-height: 1.5;
    font-weight: 800;
}
.article-title a { color: var(--primary-color); }
.article-title a:hover { color: #0072FF; }

.article-desc {
    color: var(--text-light);
    margin-bottom: 25px;
    flex-grow: 1;
    font-size: 1.05rem;
}

.read-more {
    font-weight: 800;
    color: #0072FF;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.read-more:hover { gap: 12px; }

/* =========================================
   Single Article Page
   ========================================= */
.single-article { padding: 60px 0 100px; }

.article-full {
    max-width: 850px;
    margin: 0 auto;
    padding: 50px 60px;
}

.article-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 30px;
    line-height: 1.5;
    font-weight: 900;
    text-align: center;
}

.article-img-container {
    margin-bottom: 40px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.article-img-container img { width: 100%; max-height: 500px; object-fit: cover; }

/* Content Typography & Spacing */
.article-body {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: #334155;
    line-height: 2.1;
}
.article-body h2 { 
    color: var(--primary-color); 
    margin: 60px 0 25px; 
    font-size: clamp(1.6rem, 3vw, 2.2rem); 
    font-weight: 800;
    position: relative;
    padding-right: 20px;
}
.article-body h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 6px;
    background: var(--accent-gradient);
    border-radius: 3px;
}
.article-body h3 { 
    margin: 40px 0 20px; 
    font-size: clamp(1.3rem, 2vw, 1.6rem); 
    font-weight: 800;
    color: #1e293b;
}
.article-body p { 
    margin-bottom: 25px; 
    text-align: justify;
}
.article-body strong {
    color: var(--primary-color);
    font-weight: 800;
}
.article-body ul { 
    margin: 0 30px 30px 0; 
    list-style: none;
}
.article-body ul li {
    position: relative;
    margin-bottom: 15px;
    padding-right: 25px;
}
.article-body ul li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--whatsapp-green);
    font-weight: bold;
}
.article-body img {
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin: 30px 0;
}

.article-meta {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.badge {
    background: rgba(0,114,255,0.1);
    color: #0072FF;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
}

/* =========================================
   Footer & Wave Effect
   ========================================= */
.wave-footer {
    background: var(--primary-color);
    position: relative;
    padding: 100px 0 40px;
}
.wave-footer::before {
    content: '';
    position: absolute;
    top: -50px; left: 0; right: 0;
    height: 50px;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 320" xmlns="http://www.w3.org/2000/svg"><path fill="%230A2540" fill-opacity="1" d="M0,160L48,160C96,160,192,160,288,144C384,128,480,96,576,96C672,96,768,128,864,138.7C960,149,1056,139,1152,117.3C1248,96,1344,64,1392,48L1440,32L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat center bottom;
    background-size: cover;
}

.footer-desc {
    color: #CBD5E1;
    font-size: 1.25rem;
    margin-bottom: 40px;
}

/* =========================================
   Floating WhatsApp
   ========================================= */
.floating-whatsapp {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--whatsapp-green);
    color: white;
    width: 65px; height: 65px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    animation: pulse-border 2s infinite;
    transition: var(--transition-fast);
}
.floating-whatsapp svg { width: 35px; height: 35px; }
.floating-whatsapp:hover {
    transform: translateY(-5px) scale(1.1);
    background: var(--whatsapp-hover);
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70% { box-shadow: 0 0 0 20px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* =========================================
   Pagination & Related Articles
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
}
.page-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: var(--bg-glass-solid);
    color: var(--text-dark);
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition-fast);
    text-decoration: none;
}
.page-link.prev, .page-link.next { width: auto; padding: 0 20px; font-size: 1rem; }
.page-link:hover, .page-link.active {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(10,37,64,0.2);
}

.related-articles {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px dashed rgba(0,0,0,0.1);
    text-align: right;
}
.related-articles h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 25px;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* =========================================
   Videos Section
   ========================================= */
.videos-section {
    padding: 80px 0;
}
.section-subtitle {
    text-align: center;
    color: var(--text-dark);
    opacity: 0.7;
    margin-top: -20px;
    margin-bottom: 40px;
    font-size: 1.1rem;
    font-weight: 600;
}
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.video-card {
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 16px 16px 0 0;
}
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.video-info {
    padding: 20px;
    text-align: right;
}
.video-info h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 10px;
    font-weight: 800;
}
.video-info p {
    color: var(--text-dark);
    opacity: 0.8;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* =========================================
   Responsive 
   ========================================= */
@media (max-width: 991px) {
    .article-full { padding: 40px 30px; }
}

@media (max-width: 768px) {
    .single-article { padding: 40px 0 80px; }
    .article-full { padding: 25px 20px; }
    .article-body p { text-align: right; } /* Justify isn't good for mobile */
    .nav-container { height: 55px; } /* تصغير الهيدر في الموبايل */
    .logo { font-size: 1.5rem; }
    .mobile-menu-btn span { width: 25px; height: 2px; background: #fff; } /* لون أبيض ليظهر على الخلفية الغامقة */
    
    .main-nav { 
        position: absolute; 
        top: 55px; 
        left: 0; 
        right: 0; 
        width: 100%; 
    }
    
    .nav-links {
        display: none !important;
        background: var(--primary-color); /* خلفية غامقة مثل الهيدر */
        flex-direction: column;
        padding: 20px 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .main-nav.active .nav-links { display: flex !important; }
    
    /* جعل نصوص القائمة على اليمين بدلاً من المنتصف مع لمسة احترافية */
    .nav-links li { 
        width: 100%; 
        text-align: right; 
        margin-bottom: 15px; 
        padding-right: 15px; 
        border-right: 3px solid #00C6FF; 
    }
    
    .mobile-menu-btn { display: flex; }
    .mobile-menu-btn.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .hero { padding: 90px 0 60px; min-height: 60vh; }
    
    /* تصغير زر الواتساب وإعطائه شفافية بسيطة حتى لا يخفي الكلام تحته */
    .floating-whatsapp { 
        bottom: 15px; 
        left: 15px; 
        width: 48px; 
        height: 48px; 
        opacity: 0.85; 
    }
    .floating-whatsapp svg { width: 28px; height: 28px; }
    
    .card { padding: 30px 20px; }
    .card h3 { font-size: 1.3rem; }
    .article-title { font-size: 1.2rem; }
    .btn-primary, .btn-secondary, .btn-whatsapp-large { font-size: 1rem; padding: 10px 20px; }

    /* تصغير مساحة الكلمات المفتاحية في صفحة المقال */
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        font-size: 0.95rem;
    }
    .badge {
        font-size: 0.85rem;
        padding: 4px 10px;
        display: inline-block;
        margin-top: 5px;
    }
    .video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .videos-section {
        padding: 50px 0;
    }
    
    /* تظبيط زر العودة للرئيسية في الموبايل وإبعاده عن زر الواتساب */
    .back-btn {
        width: 100%;
        text-align: center;
        margin-top: 20px;
        margin-bottom: 40px; /* مسافة إضافية حتى لا يغطيه الواتساب عند الوصول للنهاية */
        padding: 12px;
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    flex-wrap: wrap;
    gap: 15px;
}
.cookie-banner p { margin: 0; font-size: 0.95rem; line-height: 1.6; flex: 1; min-width: 250px; }
.cookie-banner button { white-space: nowrap; border-radius: 8px; font-weight: bold; }

@media (max-width: 768px) {
    .cookie-banner {
        bottom: 15px;
        left: 15px;
        right: 15px;
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }
    .cookie-banner p { font-size: 0.85rem; }
    .cookie-banner button { width: 100%; padding: 12px; }
}

/* Policy Cards */
.policy-card {
    padding: 40px;
}
@media (max-width: 768px) {
    .policy-card {
        padding: 20px;
    }
}
