/* ===== تصميم تبويب من نحن بنمط ChatGPT - تصميم راقي وحديث ===== */

/* ادارة الألوان من نحن*/
:root {
    --primary-color: #138275;
    --secondary-color: #0891b2;
    --accent-color: #0d9488;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --light-bg: #f8fafc;
    --dark-text: #1e293b;
    --light-text: #64748b;
    --gradient-primary: linear-gradient(135deg, #1C9E97 0%, #009577 100%);
    --gradient-secondary: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --text-secondary: #64748b;
}

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

/* منع الـ overflow من البداية */
*, *::before, *::after {
    max-width: 100%;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Cairo', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: #ffffff;
    width: 100%;
}

/* إصلاح overflow للكونتينر */
.container, .container-fluid {
    max-width: 100%;
    width: 100%;
}

/* إصلاح خاص للـ page-hero container */
.page-hero .container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
}

/* إصلاح النص العربي الطويل */
[dir="rtl"] .page-hero p {
    text-align: center;
    word-spacing: normal;
    letter-spacing: normal;
}

[dir="ltr"] .page-hero p {
    text-align: center;
    word-spacing: normal;
    letter-spacing: normal;
}

/* إصلاح overflow للصفوف والأعمدة */
.row {
    margin-left: 0;
    margin-right: 0;
}

.col, [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
}

/* تضمين ملف CSS الموحد للهايدر غير المسجل */
/* تم نقل جميع أنماط الهايدر إلى modern-header-offline.css */

/* Page Hero */
.page-hero {
    background: var(--gradient-primary);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 80px; /* مساحة للـ navbar العادي */
}

/* تعديل المحتوى عند وجود site-mode-alert */
body:has(.site-mode-alert) .page-hero {
    margin-top: 140px; /* site-mode-alert (60px) + navbar (80px) */
}

/* إصلاحات إضافية للجوال */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
    }

    .page-hero .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .page-hero {
        padding: 100px 0 60px;
        margin-top: 70px; /* مساحة للـ navbar على الجوال */
        width: 100%;
    }

    /* تعديل المحتوى عند وجود site-mode-alert على الجوال */
    body:has(.site-mode-alert) .page-hero {
        margin-top: 130px; /* site-mode-alert (60px) + navbar (70px) */
    }

    .page-hero h1 {
        font-size: 2.2rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .page-hero p {
        font-size: 1rem;
        margin-bottom: 1rem;
        word-wrap: break-word;
        max-width: 100%;
        padding: 0 10px;
        white-space: normal;
        overflow: hidden;
    }

    /* تم نقل أنماط الهايدر إلى modern-header-offline.css */

    .page-hero-content {
        padding: 0 5px;
        max-width: 100%;
    }

    .section {
        padding: 60px 0;
        width: 100%;
        overflow-x: hidden;
    }

    .section-title {
        font-size: 2rem;
        word-wrap: break-word;
    }

    .feature-card {
        margin-bottom: 2rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* إصلاح الجداول والعناصر الكبيرة */
    table, img, video, iframe {
        max-width: 100% !important;
        height: auto !important;
    }

    /* إصلاح النصوص الطويلة */
    h1, h2, h3, h4, h5, h6, p, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
}

@media (max-width: 576px) {
    .page-hero {
        padding: 90px 0 50px;
        margin-top: 65px; /* مساحة للـ navbar على الشاشات الصغيرة */
    }

    /* تعديل المحتوى عند وجود site-mode-alert على الشاشات الصغيرة */
    body:has(.site-mode-alert) .page-hero {
        margin-top: 125px; /* site-mode-alert (60px) + navbar (65px) */
    }

    .page-hero h1 {
        font-size: 1.8rem;
        line-height: 1.3;
        padding: 0 5px;
        max-width: 100%;
    }

    .page-hero p {
        max-width: 100%;
        padding: 0 5px;
        font-size: 0.95rem;
    }

    .page-hero-content {
        padding: 0;
        max-width: 100%;
    }

    .container {
        padding-left: 10px;
        padding-right: 10px;
        width: 100%;
        overflow-x: hidden;
    }

    .page-hero .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .feature-card, .service-card, .stats-card {
        margin: 0 0 1.5rem 0;
        padding: 1.5rem 1rem;
    }

    /* تحسين المسافات للشاشات الصغيرة */
    .section {
        padding: 40px 0;
    }

    .row {
        margin: 0;
    }

    .col, [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* إصلاح عام لمنع overflow */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* منع الـ overflow بشكل مبسط */
.page-hero, .section, .container, .row, [class*="col-"] {
    max-width: 100%;
    box-sizing: border-box;
}

/* إصلاح الـ scroll الأفقي في page-hero */
.page-hero {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* تحسين النص الطويل */
.page-hero * {
    max-width: 100%;
    box-sizing: border-box;
}



.page-hero-content {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    width: 100%;
    padding: 0 10px;
}

.timeline, .timeline-item {
    max-width: 100%;
    overflow-x: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.page-hero-content {
    position: relative;
    z-index: 2;
}

.page-hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.page-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.6;
    white-space: normal;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--light-text);
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Cards */
.feature-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
}

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

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.stats-card {
    text-align: center;
    padding: 30px 20px;
}

.stats-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--secondary-color);
    display: block;
}

.stats-label {
    font-size: 1.1rem;
    color: var(--light-text);
    margin-top: 10px;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    width: 45%;
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: 55%;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: 55%;
}

.timeline-icon {
    position: absolute;
    left: 50%;
    top: 30px;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 0 0 4px white, var(--shadow-md);
}

/* Responsive */
@media (max-width: 768px) {
    .page-hero h1 {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-content {
        width: calc(100% - 80px);
        margin-left: 80px !important;
        margin-right: 0 !important;
    }

    .timeline-icon {
        left: 30px;
    }

    .stats-number {
        font-size: 2.5rem;
    }
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 60px 0 30px;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand i {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    line-height: 1.6;
}

.footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    margin-bottom: 8px;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile Menu Styles - مثل mobileMenu في chat.php */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.show {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1200;
    padding: 1rem;
    overflow-y: auto;
}

.mobile-menu.show {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.mobile-menu-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.mobile-menu-title i {
    font-size: 1.2rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1e293b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: right;
    justify-content: flex-start;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(28, 158, 151, 0.1);
    color: var(--primary-color);
}

.mobile-nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Mobile Language Switcher */
.mobile-language-switcher {
    margin: 1rem 0;
    padding: 0;
    text-align: center;
}

.language-switcher-mobile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    color: var(--primary-color);
    justify-content: center;
}

.language-select-mobile {
    max-width: 120px;
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.language-select-mobile:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(28, 158, 151, 0.25);
}

/* Mobile Auth Buttons */
.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.mobile-auth-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: right;
    justify-content: flex-start;
}

.mobile-auth-btn.login-btn {
    color: #0891b2;
    background: rgba(8, 145, 178, 0.1);
    border: 1px solid rgba(8, 145, 178, 0.2);
}

.mobile-auth-btn.login-btn:hover {
    background: #0891b2;
    color: white;
}

.mobile-auth-btn.register-btn {
    color: white;
    background: var(--gradient-primary);
    border: 1px solid transparent;
}

.mobile-auth-btn.register-btn:hover {
    background: var(--gradient-secondary);
    transform: translateY(-1px);
}

.mobile-auth-btn i {
    font-size: 1rem;
}

/* Hide mobile menu on desktop */
@media (min-width: 992px) {
    .mobile-menu,
    .mobile-overlay {
        display: none !important;
    }
}

/* تعديل navbar-toggler للجوال */
@media (max-width: 991.98px) {
    .navbar-collapse {
        display: none !important;
    }
    
    .navbar-toggler {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary-color);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 4px;
        transition: all 0.2s ease;
    }

    .navbar-toggler:hover {
        background: rgba(28, 158, 151, 0.1);
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(19, 130, 117, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
}
