/* Global Styles */
:root {
    --primary-color: #000000;
    --secondary-color: #1A1A1A;
    --accent-color: #FFD700;
    --white: #FFFFFF;
    --light-bg: #F8F9FA;
    --dark-text: #2D3748;
    --gray-text: #718096;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    --banner-height: 50px; /* سيتم تحديثها بواسطة JS */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, sans-serif;
    color: var(--dark-text);
    padding-top: var(--banner-height); /* يعتمد على ارتفاع الشريط الفعلي */
    margin: 0;
    overflow-x: hidden;
}

/* RTL Support for Arabic */
[dir="rtl"] {
    font-family: 'Cairo', sans-serif;
}

[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[dir="rtl"] .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001 !important;
    pointer-events: auto;
}

/* عند العرض على الجوال، نضبط موقعه قليلاً */
@media (max-width: 768px) {
    .language-switcher {
        top: 10px;
        right: 10px;
    }
}

.lang-btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--accent-color) !important;
    color: var(--primary-color) !important;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    line-height: 1.5;
}

.lang-btn:hover {
    background: var(--primary-color) !important;
    color: var(--accent-color) !important;
    transform: translateY(-2px);
}

/* Navigation */
.navbar {
    background: var(--primary-color) !important;
    padding: 15px 0;
    transition: var(--transition);
    position: fixed; /* نجعله fixed لكي يتحرك مع الشريط */
    top: 0;
    width: 100%;
    z-index: 9999;
}

/* عند وجود شريط التجريبي، نضبط top بواسطة JS، وهذا القاعدة كقيمة افتراضية */
.navbar.fixed-top {
    top: 50px; /* سيتم تجاوزها بواسطة JS إذا لزم الأمر */
    transition: top 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: var(--shadow-lg);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color) !important;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 45px !important;
    width: auto !important;
    margin-right: 10px;
    object-fit: contain;
}

[dir="rtl"] .navbar-brand img {
    margin-right: 0;
    margin-left: 10px;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    padding: 8px 15px !important;
    transition: var(--transition);
    position: relative;
    z-index: 2; /* التأكد من أن الروابط قابلة للنقر */
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--accent-color);
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: 10px;
    padding: 10px;
    background: white;
    z-index: 10002; /* أعلى من الشريط */
}

.dropdown-item {
    padding: 8px 15px;
    border-radius: 5px;
    transition: var(--transition);
    color: var(--dark-text);
}

.dropdown-item:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    min-height: 600px;
    background: url('/images/logo arb ip.png') no-repeat center center;
    background-size: contain;
    background-color: var(--primary-color);
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    position: relative;
    color: white;
    z-index: 1; /* أسفل النافبار */
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-section .lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Feature Cards */
.features-section {
    padding: 80px 0;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-align: center;
    border: 1px solid rgba(0,0,0,0.05);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: var(--primary-color);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: rotate(360deg);
}

.feature-card h4 {
    margin-bottom: 15px;
    font-weight: 600;
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.btn-link:hover {
    color: var(--accent-color);
}

.btn-link:hover i {
    transform: translateX(5px);
}

[dir="rtl"] .btn-link:hover i {
    transform: translateX(-5px);
}

/* Page Header */
.page-header {
    background: var(--primary-color);
    padding: 60px 0;
    margin-top: 80px;
    color: white;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.page-header .lead {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Team Cards */
.team-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-align: center;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.team-card img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
}

.team-card .social-links a {
    display: inline-block;
    width: 35px;
    height: 35px;
    background: var(--light-bg);
    color: var(--primary-color);
    border-radius: 50%;
    line-height: 35px;
    margin: 0 5px;
    transition: var(--transition);
}

.team-card .social-links a:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Footer */
.footer-section {
    background: var(--primary-color);
    color: white;
    margin-top: 50px;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--accent-color) !important;
}

.footer-section .social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 50%;
    line-height: 40px;
    text-align: center;
    margin-right: 8px;
    transition: var(--transition);
}

.footer-section .social-links a:hover {
    background: var(--accent-color);
    color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-color);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-color);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-outline-light:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-color);
}

/* Social Links (general) */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    margin: 0 5px;
}

.social-links a:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--primary-color);
        padding: 20px;
        border-radius: 10px;
        margin-top: 10px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px; /* زيادة المسافة في الجوال */
    }
    
    .language-switcher {
        top: 10px;
        right: 10px;
    }

    .lang-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .hero-section {
        min-height: 400px;
        padding: 40px 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin: 10px 0 !important;
    }

    .features-section {
        padding: 40px 0;
    }

    .feature-card {
        padding: 20px;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .page-header {
        padding: 40px 0;
        margin-top: 60px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header .lead {
        font-size: 1rem;
    }

    .team-card {
        padding: 20px;
    }

    .team-card img {
        width: 120px;
        height: 120px;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section .col-md-6 {
        margin-bottom: 20px;
    }

    .footer-section .text-md-end,
    .footer-section .text-md-start {
        text-align: center !important;
    }

    .footer-section .social-links a {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 0.9rem;
        margin: 0 4px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }

    .feature-card {
        padding: 15px;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .dropdown-menu {
        position: static !important;
        width: 100%;
        margin-top: 0;
        background-color: rgba(255,255,255,0.1);
        border: none;
        box-shadow: none;
    }

    .dropdown-item {
        color: white !important;
    }

    .dropdown-item:hover {
        background: var(--accent-color);
        color: var(--primary-color) !important;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .feature-card {
        padding: 25px;
    }
}

/* Bootstrap container */
.container {
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

/* Row */
.row {
    margin-right: -15px;
    margin-left: -15px;
}

img {
    max-width: 100%;
    height: auto;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.btn-block {
    display: block;
    width: 100%;
}

/* حل مشكلة التمرير */
html, body {
    overflow-x: hidden;
    width: 100%;
    height: auto;
}

/* التأكد من أن جميع الأزرار قابلة للنقر */
.navbar-nav .nav-link,
.dropdown-item,
.btn,
.hero-buttons .btn,
.language-switcher .lang-btn {
    pointer-events: auto !important;
    cursor: pointer;
}

/* منع أي عناصر شفافة من التغطية */
body > *:not(.language-switcher):not(.navbar):not(#trial-banner) {
    pointer-events: auto;
}

/* ========== شريط البث التجريبي ========== */
#trial-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    background-color: #ffc107;
    color: #000;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    border-bottom: 2px solid #000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    font-size: 0.9rem;
}

#trial-banner i {
    font-size: 1.1rem;
}

/* ضبط المسافة الأساسية للـ body عندما لا يتم ضبطها بواسطة JS */
body {
    padding-top: 50px;
}

/* جعل النافبار يبدأ بعد الشريط مباشرة (سيتم ضبطه بواسطة JS أيضاً) */
.navbar.fixed-top {
    top: 50px;
    transition: top 0.3s ease;
}

/* تحسين ظهور القائمة المنسدلة في الشاشات الصغيرة */
@media (max-width: 768px) {
    .navbar-collapse {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    .dropdown-menu {
        background: rgba(0,0,0,0.9);
        border: 1px solid rgba(255,255,255,0.2);
    }
    .dropdown-item {
        color: white !important;
        padding: 10px 20px;
    }
    .dropdown-item:hover {
        background: var(--accent-color);
        color: var(--primary-color) !important;
    }
}

/* حل مشكلة اختفاء الأزرار بسبب التداخل */
.navbar .navbar-toggler {
    z-index: 2;
}

/* تحسين المسافات بين أزرار الهيرو */
.hero-buttons .btn {
    margin: 0.5rem;
}