/* ============================================================
   common.css - الملف الأساسي لتنسيقات الموقع
   يستخدم في جميع صفحات الموقع
   ============================================================ */

/* ===== إعادة تعيين الإعدادات الافتراضية ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

/* ===== عناوين الصفحات ===== */
.heading, .heading-font {
    font-weight: 800;
    letter-spacing: -0.025em;
}

/* ===== تحسين وضوح العناصر عند استخدام لوحة المفاتيح ===== */
:focus-visible {
    outline: 3px solid #16a34a;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== زر "تخطي إلى المحتوى" لمساعدة مستخدمي قارئات الشاشة ===== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: #16a34a;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 99999;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 20px;
}

/* ============================================================
   الأزرار
   ============================================================ */

/* الزر الرئيسي - أخضر */
.btn-primary {
    background: #16a34a;
    color: #ffffff;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.32, 1);
}

.btn-primary:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px -8px rgba(22, 163, 74, 0.35);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* الزر الثانوي - حدود رمادية */
.btn-outline {
    background: transparent;
    color: #0f172a;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.32, 1);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #0f172a;
    transform: translateY(-2px);
}

/* الزر الثانوي - أبيض على خلفية داكنة */
.btn-outline-white {
    background: transparent;
    color: #ffffff;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.32, 1);
}

.btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

/* ============================================================
   الشريط العلوي (Header)
   ============================================================ */

.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================================
   شعار الموقع (Logo)
   ============================================================ */

.logo-header {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-header .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-header .logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1.25);
}

.logo-header .logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.logo-header .logo-text .highlight {
    color: #16a34a;
}

/* ============================================================
   زر واتساب العائم
   ============================================================ */

.whatsapp-float {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.whatsapp-float .whatsapp-icon {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    animation: pulse-whatsapp 2s infinite;
    transition: all 0.3s ease;
}

.whatsapp-float .whatsapp-icon svg {
    width: 34px;
    height: 34px;
    fill: #ffffff;
}

.whatsapp-float:hover .whatsapp-icon {
    transform: scale(1.08);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
    animation: none;
}

.whatsapp-float .whatsapp-tooltip {
    background: #ffffff;
    padding: 10px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    border: 1px solid #e2e8f0;
    position: relative;
}

.whatsapp-float .whatsapp-tooltip::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 8px 8px 0;
    border-style: solid;
    border-color: transparent #ffffff transparent transparent;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}

.whatsapp-float .whatsapp-tooltip small {
    display: block;
    font-weight: 400;
    font-size: 12px;
    color: #64748b;
}

/* حركة نبض زر واتساب */
@keyframes pulse-whatsapp {
    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);
    }
}

/* إخفاء النص في الشاشات الصغيرة */
@media (max-width: 640px) {
    .whatsapp-float {
        bottom: 20px;
        left: 20px;
    }
    .whatsapp-float .whatsapp-icon {
        width: 50px;
        height: 50px;
    }
    .whatsapp-float .whatsapp-icon svg {
        width: 28px;
        height: 28px;
    }
    .whatsapp-float .whatsapp-tooltip {
        display: none;
    }
}

/* ============================================================
   نافذة الاتصال (Modal)
   ============================================================ */

.contact-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.contact-modal.active {
    display: flex;
}

.contact-modal .modal-content {
    background: #ffffff;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    padding: 30px;
    position: relative;
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

/* حركة ظهور النافذة */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.contact-modal .close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.contact-modal .close-modal:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.contact-modal .close-modal:focus-visible {
    outline: 2px solid #16a34a;
}

.contact-modal .contact-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #0f172a;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    cursor: pointer;
}

.contact-modal .contact-option:hover {
    border-color: #16a34a;
    background: #f0fdf4;
    transform: translateX(5px);
}

.contact-modal .contact-option:focus-visible {
    outline: 2px solid #16a34a;
}

.contact-modal .contact-option .icon {
    font-size: 28px;
}

.contact-modal .contact-option .info h4 {
    font-weight: 700;
    font-size: 16px;
    margin: 0;
}

.contact-modal .contact-option .info p {
    font-size: 13px;
    color: #64748b;
    margin: 2px 0 0 0;
}

.contact-modal .contact-option .arrow {
    margin-left: auto;
    color: #94a3b8;
    font-size: 20px;
}

.contact-modal .contact-option:hover .arrow {
    color: #16a34a;
}

/* ============================================================
   قسم الأسئلة الشائعة (FAQ)
   ============================================================ */

.faq-question {
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background-color: #f8fafc;
}

.faq-question .icon {
    transition: transform 0.3s ease;
}

.faq-question.active .icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.faq-answer.open {
    max-height: 600px;
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.faq-answer p {
    margin-top: 0.75rem;
    line-height: 1.7;
}

/* ============================================================
   دليل التثبيت (Installation Guide)
   ============================================================ */

.guide-header {
    cursor: pointer;
    transition: all 0.3s ease;
}

.guide-header:hover {
    background: #f8fafc;
}

.guide-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.guide-wrapper.open {
    max-height: 2000px;
    padding: 1.5rem;
}

.guide-step {
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 0;
}

.guide-step:last-child {
    border-bottom: none;
}

.guide-step .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #16a34a;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

/* ============================================================
   تحسينات للشاشات الصغيرة (جوال)
   ============================================================ */

@media (max-width: 640px) {
    .bg-white {
        padding: 20px !important;
    }
    
    h1 {
        font-size: 1.8rem !important;
    }
    
    section h2 {
        font-size: 1.2rem !important;
    }
    
    section p,
    section li {
        font-size: 0.95rem !important;
    }
    
    .logo-header .logo-text {
        font-size: 15px;
    }
    
    .logo-header .logo-icon {
        width: 34px;
        height: 34px;
    }
}