/* ----------------------------------------------------------- */
/* HERO SECTION */
/* ----------------------------------------------------------- */
.contact-hero { 
    padding: 8rem 0 4rem 0; 
    text-align: center; 
    max-width: 80rem; 
    margin: 0 auto; 
}

.hero-headline { 
    font-size: 3rem; 
    font-weight: 700; 
    color: var(--text-color); 
    margin-bottom: 1.5rem; 
    letter-spacing: -0.02em; 
    line-height: 1.1; 
    white-space: nowrap; 
}

/* ----------------------------------------------------------- */
/* LAYOUT */
/* ----------------------------------------------------------- */
.contact-interface { 
    display: flex; 
    gap: 4rem; 
    max-width: var(--mw-content); 
    margin: 0 auto 8rem auto; 
    padding: 0 2rem; 
    align-items: flex-start; 
}

.form-column { flex: 1.4; }
.info-column { flex: 0.8; display: flex; flex-direction: column; gap: 1.5rem; }

/* ----------------------------------------------------------- */
/* GLASS FORM CARD */
/* ----------------------------------------------------------- */
.glass-form-card {
    background: var(--surface-color); 
    backdrop-filter: blur(1.875rem); /* 30px */
    -webkit-backdrop-filter: blur(1.875rem);
    padding: 3rem; 
    border-radius: 1.5rem; /* 24px */
    border: 1px solid var(--border-color); 
    box-shadow: var(--card-shadow);
    position: relative; 
    overflow: visible; 
}

.form-row { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; }
.mobile-row { align-items: stretch; }

/* ----------------------------------------------------------- */
/* INPUT STYLING */
/* ----------------------------------------------------------- */
.input-group { position: relative; width: 100%; margin-bottom: 1.5rem; }
.form-row .input-group { margin-bottom: 0; }

input, textarea {
    width: 100%; 
    padding: 1.8rem 1rem 0.6rem 1rem;
    background: rgba(255,255,255,0.03); 
    border: none; 
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.5rem 0.5rem 0 0; /* 8px */
    color: var(--text-color); 
    font-family: var(--font-primary);
    font-size: 1rem; 
    transition: all 0.3s ease; 
    outline: none; 
    height: 4.2rem;
}

textarea { height: 9rem; resize: none; padding-top: 2rem; }

/* Floating Labels */
.input-group label {
    position: absolute; 
    left: 1rem; 
    top: 1.4rem; 
    font-size: 1rem; 
    color: var(--text-subtle);
    pointer-events: none; 
    transition: all 0.3s ease;
}

input:focus ~ label, input:not(:placeholder-shown) ~ label, textarea:focus ~ label, textarea:not(:placeholder-shown) ~ label {
    top: 0.6rem; 
    font-size: 0.75rem; 
    color: var(--text-color); 
    opacity: 0.7;
}

/* Glow Border Effect */
.glow-border {
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 0; 
    height: 0.125rem; /* 2px */
    background: linear-gradient(90deg, var(--aurora-1), var(--aurora-2)); 
    transition: width 0.4s ease;
}
input:focus ~ .glow-border, textarea:focus ~ .glow-border, .custom-select-wrapper.open .glow-border { width: 100%; }

/* ----------------------------------------------------------- */
/* CUSTOM DROPDOWNS */
/* ----------------------------------------------------------- */
.custom-select-wrapper { position: relative; cursor: pointer; height: 4.2rem; }

.custom-select-trigger {
    width: 100%; 
    height: 100%;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 1.8rem 1rem 0.6rem 1rem;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0.5rem 0.5rem 0 0; /* 8px */
    color: var(--text-color);
    font-size: 1rem; 
    transition: all 0.3s ease;
}

.arrow { font-size: 0.8rem; color: var(--text-subtle); transition: transform 0.3s; }
.custom-select-wrapper.open .arrow { transform: rotate(180deg); }

.floating-label-custom {
    position: absolute; 
    left: 1rem; 
    top: 1.4rem; 
    font-size: 1rem;
    color: var(--text-subtle); 
    pointer-events: none; 
    transition: all 0.3s ease;
}

.custom-select-wrapper.selected .floating-label-custom,
.custom-select-wrapper.open .floating-label-custom {
    top: 0.6rem; font-size: 0.75rem; opacity: 0.7;
}

/* Dropdown List */
.custom-options {
    position: absolute; 
    top: 100%; 
    left: 0; 
    width: 100%;
    max-height: 15.625rem; /* 250px */
    overflow-y: auto;
    background: var(--bg-color); 
    border: 1px solid var(--border-color); 
    border-radius: 0 0 0.75rem 0.75rem; /* 12px */
    box-shadow: 0 0.9375rem 1.875rem rgba(0,0,0,0.1); /* 15px 30px */
    z-index: 100;
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(-0.625rem); /* -10px */
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-select-wrapper.open .custom-options {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.custom-option {
    padding: 1rem 1.2rem; 
    color: var(--text-color); 
    font-size: 0.95rem;
    cursor: pointer; 
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
}
.custom-option:last-child { border-bottom: none; }

.custom-option:hover {
    background: var(--surface-color); 
    padding-left: 1.5rem; 
    color: var(--text-color);
}

.option-group-label {
    padding: 0.5rem 1rem; 
    font-size: 0.75rem; 
    font-weight: 700; 
    letter-spacing: 0.1em;
    color: var(--text-subtle); 
    text-transform: uppercase;
    background: rgba(0,0,0,0.02); 
    pointer-events: none;
}

/* Specific Widths */
.flag-group { flex: 0.4; min-width: 6rem; }
.phone-input { flex: 1; }

.form-footer { margin-top: 2rem; }
.glow-btn.full-width { width: 100%; text-align: center; }

/* ----------------------------------------------------------- */
/* INFO TILES */
/* ----------------------------------------------------------- */
.info-tile {
    display: flex; 
    align-items: center; 
    gap: 1.5rem;
    background: var(--surface-color); 
    backdrop-filter: blur(1.25rem); /* 20px */
    border: 1px solid var(--border-color); 
    padding: 1.5rem; 
    border-radius: 1rem; /* 16px */
    transition: all 0.3s ease;
}

.info-tile:hover { 
    transform: translateX(0.625rem); /* 10px */
    background: var(--glass-bg); 
    border-color: var(--text-color); 
    box-shadow: 0 0.625rem 1.875rem rgba(0,0,0,0.05); /* 10px 30px */
}

.tile-icon-box { 
    width: 3.5rem; 
    height: 3.5rem; 
    background: rgba(255,255,255,0.05); 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 1.2rem; 
    color: var(--text-color); 
    border: 1px solid var(--border-color); 
}

.info-tile h4 { 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    color: var(--text-subtle); 
    margin-bottom: 0.2rem; 
}

.tile-details {
    display: flex; 
    flex-direction: column; 
    gap: 0.2rem;
}

.tile-details p, .contact-link { 
    font-size: 1.1rem; 
    color: var(--text-color); 
    font-weight: 600; 
    line-height: 1.4; 
    text-decoration: none; 
}

.contact-link:hover { text-decoration: underline; }

/* ----------------------------------------------------------- */
/* NEW: SOCIAL CONNECT TILE */
/* ----------------------------------------------------------- */
.social-connect-tile {
    background: var(--surface-color);
    backdrop-filter: blur(1.25rem); /* 20px */
    border: 1px solid var(--border-color);
    border-radius: 1rem; /* 16px */
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.social-connect-tile:hover {
    background: var(--glass-bg);
    border-color: var(--text-color);
    box-shadow: 0 0.625rem 1.875rem rgba(0,0,0,0.05); /* 10px 30px */
}

.social-connect-tile h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-subtle);
    margin-bottom: 1.2rem;
}

.social-hub-icons {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
}

.hub-icon {
    width: 3rem; 
    height: 3rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    display: flex; justify-content: center; align-items: center;
    color: var(--text-color);
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
}

.hub-icon:hover {
    transform: translateY(-0.25rem); /* -4px */
    background: var(--text-color);
    color: var(--bg-color);
    border-color: transparent;
    box-shadow: 0 0 1.25rem var(--aurora-1); /* 20px */
}

/* ----------------------------------------------------------- */
/* SUCCESS MODAL STYLES */
/* ----------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(0.5rem); /* 8px */
    z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1; pointer-events: auto;
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: 1.5rem; /* 24px */
    max-width: 30rem;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 1.25rem 3.125rem rgba(0,0,0,0.2);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    width: 5rem; height: 5rem;
    background: var(--text-color);
    color: var(--bg-color);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 0 1.875rem var(--aurora-1);
}

.modal-content h2 {
    font-size: 1.8rem; margin-bottom: 1rem; color: var(--text-color);
}

.modal-content p {
    font-size: 1rem; color: var(--text-subtle); line-height: 1.6; margin-bottom: 2rem;
}

.modal-content button {
    min-width: 10rem;
}

/* Standardize Desktop Spacing */
.contact-hero {
    padding: 4rem 0 2rem 0; /* Aligned with Home Hero */
    margin-bottom: 0; 
}

.contact-interface {
    margin-bottom: 0rem; /* Standard section gutter */
}

.footer {
    margin-top: 4rem; /* Consistent footer push */

}

/* ----------------------------------------------------------- */
/* RESPONSIVE */
/* ----------------------------------------------------------- */
/* Laptop & Tablet (Max 64rem / 1024px) */
@media (max-width: 64rem) {

    /* 1. HEADER & HERO ALIGNMENT */
    .contact-hero {
        padding: 4rem 1.5rem; /* Matches Home/About mobile padding */
        max-width: 100%; /* Expands to full header width */
    }

    .hero-headline {
        font-size: 2.5rem; /* Standard scaling */
        white-space: normal;
        line-height: 1.1;
    }

    /* 2. FULL-WIDTH FORM LAYOUT */
    .contact-interface {
        flex-direction: column; /* Stacks form and info */
        gap: 3rem;
        padding: 0rem;
        margin-bottom: 4rem; /* Aligns with Home showcased sections */
        width: 100%; /* Expands to fit with header */
        max-width: 100%; 
    }

    .form-column, 
    .info-column { 
        width: 100%; /* Ensures both columns fill the width */
    }

    .glass-form-card {
        
        border-radius: 1.5rem; /* Original radius preserved */
        width: 100%; 
    }

    /* 3. CONTACT INFO (PRESERVED ORIGINAL STYLE) */
    .info-column {
        gap: 1.5rem; /* Original gap preserved */
    }

    .info-tile {
        /* Layout, padding, and icons remain as you provided them */
        padding: 1.5rem;
        transform: none !important;
    }

    /* Ensuring icons remain circular as per your original code */
    .tile-icon-box {
        width: 3.5rem;
        height: 3.5rem;
        border-radius: 50%; /* Keeps circular icons */
        flex-shrink: 0;
    }

    /* 4. FOOTER FLUSH */
    .footer {margin:  0rem; padding: 2rem 0rem;}
    
}

/* Small Mobile (Max 48rem / 768px) */
@media (max-width: 48rem) {
    .contact-hero {
        padding-top: 3rem;
    }

    .hero-headline {
        font-size: 2rem;
    }

    .glass-form-card {
        padding: 2rem 1rem;
    }
}

/* =========================================
   RTL (Arabic) Specific Fixes for Contact Form
   ========================================= */

/* --- 1. Align Floating Labels to the Right --- */
/* This moves the label text (like "الاسم الأول") to the right side */
[dir="rtl"] .input-group label,
[dir="rtl"] .floating-label-custom {
    left: auto !important;
    right: 1rem; /* Adjust this value if it's too close/far from the edge */
    transform-origin: top right; /* Ensures the label shrinks towards the right */
    text-align: right;
}

/* Ensure textareas also align text right */
[dir="rtl"] .input-group textarea {
    text-align: right;
}

/* --- 2. Mobile Number Section Fixes --- */

/* Ensure the container aligns elements to the right */
[dir="rtl"] .mobile-row {
    justify-content: flex-start; /* In RTL, flex-start is the right side */
}

/* Force numbers and flag dropdown to remain Left-to-Right (LTR) for readability */
[dir="rtl"] .flag-group .custom-select-trigger,
[dir="rtl"] .flag-group .custom-options,
[dir="rtl"] .phone-input input {
    direction: ltr !important; /* Forces +962 to display correctly */
    text-align: left; /* Keeps the numbers aligned to the left inside their boxes */
}

/* Fix the arrow position in the LTR flag dropdown */
[dir="rtl"] .flag-group .custom-select-trigger {
    display: flex;
    flex-direction: row-reverse; /* Puts the arrow on the left of the numbers */
    align-items: center;
    justify-content: space-between;
}

/* Ensure the phone input label still aligns right, even though the input is LTR */
[dir="rtl"] .phone-input label {
    direction: rtl;
    right: 1rem;
    left: auto !important;
    text-align: right;
}

/* =========================================
   Arabic (RTL) Layout Fix: Swapping Phone Boxes
   ========================================= */

/* 1. Swap Box Positions: Force Country Code to Left and Mobile to Right */
[dir="rtl"] .mobile-row {
    display: flex !important;
    flex-direction: row-reverse !important; /* Forces first child to the left side */
    gap: 1rem; /* Maintains the gap between boxes */
}

/* 2. Fix the Labels (Align text to the right inside the boxes) */
[dir="rtl"] .mobile-row .input-group label {
    right: 1rem !important;
    left: auto !important;
    text-align: right !important;
    width: 100%;
}

/* 3. Keep Numbers LTR but aligned to the right of their box */
[dir="rtl"] .phone-input input {
    direction: ltr !important; /* Keeps +962 format correct */
    text-align: right !important; /* Aligns the cursor/number to the right side of the box */
    unicode-bidi: plaintext; /* Prevents punctuation from jumping */
}

/* 4. Country Code Box alignment */
[dir="rtl"] .flag-group .custom-select-trigger {
    direction: ltr !important;
    justify-content: flex-end !important; /* Aligns +962 to the right side of the small box */
    padding-right: 1rem;
}

/* Fix the flag icon and arrow layout for the swapped position */
[dir="rtl"] .flag-group .custom-select-trigger .selected-text {
    order: 2;
}
[dir="rtl"] .flag-group .custom-select-trigger .arrow {
    order: 1;
    margin-right: 0;
    margin-left: 0.5rem;
}


/* --- Fix for Phone Numbers in Arabic View --- */
[dir="rtl"] .tile-details {
    text-align: right; /* Aligns the entire text block to the right */
    display: flex;
    flex-direction: column;
}

[dir="rtl"] .phone-number {
    direction: ltr !important;   /* Forces the +962 to read left-to-right */
    unicode-bidi: plaintext;     /* Prevents symbols from jumping to the wrong side */
    display: inline-block;       /* Ensures it respects the direction rule */
    width: fit-content;          /* Keeps the clickable area tight to the numbers */
    margin-inline-start: auto;   /* Pushes the LTR block to the right side of the container */
}