/* 
    ZamnStock - Contact Page Styles
    تصميم صفحة تواصل معنا
    (تم استثناء النافبار، الفوتر، وزر الواتساب)
*/

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

/* ==================== 2. المتغيرات والألوان ==================== */
:root {
    /* الألوان الرئيسية */
    --primary-color: #377E4F;
    --primary-dark: #2a613d;
    --primary-light: #e8f5e9;
    --primary-lighter: #f0f9f1;

    /* ألوان التمييز */
    --accent-color: #25D366;
    --accent-light: #dcfce7;

    /* ألوان النصوص */
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --text-light: #9ca3af;

    /* ألوان النموذج */
    --input-bg: #ffffff;
    --input-border: #e5e7eb;
    --input-focus: #377E4F;
    --input-error: #dc3545;
    --input-error-bg: #fef2f2;

    /* الخلفيات */
    --bg-light: #f9fafb;
    --bg-white: #ffffff;

    /* الظلال */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px rgba(55, 126, 79, 0.15);
    --shadow-lg: 0 20px 40px rgba(55, 126, 79, 0.2);

    /* الزوايا والمسافات */
    --radius: 12px;
    --radius-lg: 20px;
    --radius-pill: 50px;

    /* التحولات */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* ==================== 3. التنسيقات العامة ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* دعم التبديل بين اللغات */
html[lang="en"] body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html[lang="ar"] body {
    font-family: 'Tajawal', 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

p {
    margin-bottom: 1rem;
    color: var(--text-gray);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}



/* تأثير ناعم عند تغيير اللغة */
[data-key],
[data-img-alt] {
    transition: opacity var(--transition-fast);
}

/* ==================== 4. قسم الهيرو ==================== */
.contact-hero {
    padding: 70px 0 40px;
    background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--bg-white) 60%, var(--bg-light) 100%);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.contact-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(55, 126, 79, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(20px, -20px) scale(1.05);
    }
}

.contact-hero .container {
    position: relative;
    z-index: 1;
}

.contact-hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: fadeInDown 0.6s ease;
}

.contact-hero .lead {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--text-gray);
    max-width: 700px;
    margin: 0 auto 2rem;
    animation: fadeInDown 0.6s ease 0.1s backwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* بادجات الهيرو */
.contact-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

.contact-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-white);
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.contact-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.contact-badge i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 5. قسم نموذج التواصل ==================== */
.contact-form-section {
    padding: 40px 0 60px;
}

.contact-form-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
}

/* رسالة النجاح */
.success-message {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-lighter);
    color: var(--primary-dark);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
    border-right: 4px solid var(--accent-color);
    animation: slideInDown 0.3s ease;
}

html[dir="ltr"] .success-message {
    border-right: none;
    border-left: 4px solid var(--accent-color);
}

.success-message.show {
    display: flex;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* عنوان النموذج */
.form-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-title span {
    color: var(--primary-color);
}

/* مجموعات الحقول */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.required {
    color: var(--input-error);
    margin-left: 0.25rem;
}

html[dir="ltr"] .required {
    margin-left: 0;
    margin-right: 0.25rem;
}

/* حقول الإدخال */
.form-control,
.form-select {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--input-border);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text-dark);
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(55, 126, 79, 0.15);
}

.form-control::placeholder,
.form-select:invalid {
    color: var(--text-light);
}

.form-control.is-invalid {
    border-color: var(--input-error);
    background-color: var(--input-error-bg);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.2rem;
    border: 2px solid var(--input-border);
    border-radius: 4px;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-check-label a {
    font-weight: 600;
}

/* زر الإرسال */
.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(55, 126, 79, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.submit-btn .loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .loading-spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ملاحظة الأمان */
.form-note {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.form-note i {
    color: var(--accent-color);
}

/* ==================== 6. قسم الأسئلة الشائعة ==================== */
.faq-section {
    padding: 60px 0;
    background: var(--bg-white);
}

.faq-section .text-center {
    margin-bottom: 2.5rem;
}

.faq-section h2 {
    color: var(--primary-color);
    font-size: clamp(1.4rem, 4vw, 1.8rem);
}

.faq-section .text-muted {
    font-size: 1.05rem;
}

/* عنصر السؤال */
.faq-item {
    background: var(--bg-light);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: var(--transition);
    border: 2px solid transparent;
}

.faq-item:hover,
.faq-item.active {
    border-color: var(--primary-color);
    background: var(--primary-lighter);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.05rem;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-question i {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 0 1.5rem 1.5rem;
}

.faq-answer p {
    margin: 0;
    color: var(--text-gray);
    line-height: 1.8;
    font-size: 0.95rem;
}

/* ==================== 7. تحسينات التجاوب ==================== */

/* أجهزة اللابتوب الصغيرة والتابلت */
@media (max-width: 991px) {
    .contact-form-wrapper {
        padding: 2rem 1.5rem;
    }
}

/* الموبايل */
@media (max-width: 768px) {

    /* الهيرو */
    .contact-hero {
        padding: 50px 0 30px;
    }

    .contact-hero h1 {
        font-size: 1.6rem;
    }

    .contact-badges {
        flex-direction: column;
        align-items: center;
    }

    /* النموذج */
    .contact-form-wrapper {
        padding: 1.75rem;
        border-radius: var(--radius);
    }

    .form-title {
        font-size: 1.3rem;
    }

    .form-control,
    .form-select {
        padding: 0.75rem 0.9rem;
        font-size: 0.95rem;
    }

    .submit-btn {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
    }

    /* الأسئلة الشائعة */
    .faq-question {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }

    .faq-answer {
        padding: 0 1.25rem 1.25rem;
    }
}

/* الموبايل الصغير */
@media (max-width: 576px) {
    .contact-hero h1 {
        font-size: 1.4rem;
    }

    .contact-hero .lead {
        font-size: 1rem;
    }

    .form-title {
        font-size: 1.2rem;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .submit-btn {
        padding: 0.8rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* ==================== 8. تحسينات إمكانية الوصول ==================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* تحسينات التركيز */
a:focus-visible,
button:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* تحسينات الطباعة */
@media print {

    .navbar,
    footer,
    .whatsapp-float {
        display: none !important;
    }

    .contact-form-wrapper {
        box-shadow: none;
        padding: 0;
    }

    .submit-btn {
        display: none;
    }
}

/* ==================== 9. الوضع الداكن (Dark Mode) ==================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #111827;
        --bg-white: #1f2937;
        --text-dark: #f9fafb;
        --text-gray: #9ca3af;
        --text-light: #6b7280;
        --input-bg: #374151;
        --input-border: #4b5563;
        --primary-light: rgba(55, 126, 79, 0.2);
        --primary-lighter: rgba(55, 126, 79, 0.15);
    }

    .contact-form-wrapper,
    .faq-item {
        background: var(--bg-white);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .contact-badge {
        background: var(--input-bg);
        color: var(--text-dark);
    }

    .form-control,
    .form-select {
        background: var(--input-bg);
        border-color: var(--input-border);
        color: var(--text-dark);
    }

    .form-control::placeholder {
        color: var(--text-light);
    }

    .faq-item:hover,
    .faq-item.active {
        background: rgba(55, 126, 79, 0.15);
    }

    .success-message {
        background: rgba(37, 211, 102, 0.15);
        border-color: var(--accent-color);
    }
}

/* ==================== 10. تأثيرات تحميل إضافية ==================== */
.contact-hero h1,
.contact-hero .lead,
.contact-badges {
    animation: fadeInUp 0.6s ease backwards;
}

.contact-form-wrapper {
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

.faq-section {
    animation: fadeInUp 0.6s ease 0.3s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 11. تحسينات إضافية للغة الإنجليزية ==================== */
html[lang="en"] .form-title {
    font-size: 1.4rem;
}

html[lang="en"] .contact-badge {
    font-size: 0.9rem;
}

/* ضبط هوامش الأيقونات في القوائم حسب الاتجاه */
html[dir="ltr"] .contact-badge i {
    margin-left: 0.5rem;
    margin-right: 0;
}

html[dir="rtl"] .contact-badge i {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* تحسين عرض النصوص الطويلة في الإنجليزية */
html[lang="en"] .form-control::placeholder {
    font-size: 0.95rem;
}

/* إصلاح مشكلة التصاق النص في checkbox */
.form-check {
    display: flex;
    align-items: center;
    /* محاذاة عمودية في المنتصف */
    gap: 10px;
    /* مسافة بين المربع والنص */
    margin-bottom: 1rem;
}

.form-check-input {
    margin-top: 0;
    /* إزالة الـ margin-top الافتراضي */
    flex-shrink: 0;
    /* منع تصغير حجم المربع */
}

.form-check-label {
    display: inline-block;
    line-height: 1.5;
}

/* للتأكد من أن المسافات بين الكلمات صحيحة في كلتا اللغتين */
html[dir="rtl"] .form-check-label a,
html[dir="ltr"] .form-check-label a {
    margin: 0 4px;
}