@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #0f172a;
    --accent: #10b981;
    --accent-dark: #059669;
    --whatsapp: #25D366;
    --whatsapp-dark: #128C7E;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --card-border: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    margin: 0;
    padding-bottom: calc(76px + var(--safe-bottom)); /* Space for mobile sticky bar with iPhone notch/bar */
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 992px) {
    body {
        padding-bottom: 0;
    }
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Header & Navbar */
.main-site-navbar {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    padding: 10px 0;
    transition: all 0.25s ease;
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--secondary) !important;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin-inline-end: 15px;
}
.header-logo {
    height: 42px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}
.brand-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
}

/* Desktop Pill Navigation Bar */
.nav-links-pill-container {
    background: #f8fafc;
    padding: 5px 8px;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    gap: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}
.nav-links-pill-container .nav-link {
    font-weight: 600;
    font-size: 0.88rem;
    color: #475569 !important;
    padding: 8px 14px !important;
    border-radius: 30px;
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}
.nav-links-pill-container .nav-link i {
    font-size: 0.9rem;
    color: var(--primary);
    transition: transform 0.2s ease;
}
.nav-links-pill-container .nav-link:hover {
    color: var(--primary) !important;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.nav-links-pill-container .nav-link:hover i {
    transform: translateY(-1px) scale(1.1);
}
.nav-links-pill-container .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.28);
}
.nav-links-pill-container .nav-link.active i {
    color: #ffffff !important;
}

/* Mobile Drawer Nav Items */
.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 10px;
    transition: all 0.18s ease;
}
.mobile-nav-item:hover, .mobile-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
}
.hero-title {
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 1.2rem;
    color: #ffffff;
}
.hero-title span {
    color: #38bdf8;
}
.hero-subtitle {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
    max-width: 600px;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, 0.25);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn-primary-custom {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 28px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
}
.btn-primary-custom:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}
.btn-whatsapp {
    background-color: var(--whatsapp);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-whatsapp:hover {
    background-color: var(--whatsapp-dark);
    color: #fff;
    transform: translateY(-2px);
}

/* Multi-step Form */
.lead-form-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--card-border);
    padding: 30px;
    position: relative;
}
.form-step {
    display: none;
}
.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    position: relative;
}
.step-progress-bar {
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
}
.step-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 15px;
}
.option-label {
    display: block;
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    background: #fff;
}
.option-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.option-label input[type="radio"] {
    display: none;
}
.option-label.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: 0 0 0 1px var(--primary);
}

/* Upload dropzone */
.upload-dropzone {
    border: 2px dashed #94a3b8;
    border-radius: var(--radius-md);
    padding: 30px 15px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.upload-dropzone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.upload-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}
.preview-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
}

/* Feature cards */
.feature-card {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    padding: 24px;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.feature-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
    background: var(--primary-light);
    color: var(--primary);
}

/* Brand badges */
.brand-pill {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    color: var(--secondary);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.brand-pill:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}

/* Governorate link badge */
.gov-pill {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-main);
    font-weight: 600;
    display: inline-block;
    margin: 4px;
    transition: all 0.2s ease;
}
.gov-pill:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Sticky mobile CTA bar */
.mobile-sticky-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    padding: 8px 12px calc(8px + var(--safe-bottom));
    z-index: 1050;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
}
@media (max-width: 991px) {
    .mobile-sticky-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .mobile-sticky-bar .btn {
        flex: 1;
        padding: 9px 8px;
        font-size: 0.88rem;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border-radius: 50px;
        min-height: 44px;
        text-decoration: none;
        white-space: nowrap;
    }
    .mobile-sticky-bar .btn-call {
        flex: 1;
        background: #f8fafc;
        border: 1px solid #cbd5e1;
        color: #1e293b;
    }
    .mobile-sticky-bar .btn-wa {
        flex: 1.1;
        background: var(--whatsapp);
        color: #fff;
        border: none;
    }
    .mobile-sticky-bar .btn-sell {
        flex: 1.5;
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        color: #fff;
        border: none;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    }
}

/* Floating WhatsApp button (desktop/tablet) */
.floating-whatsapp-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 60px;
    height: 60px;
    background-color: var(--whatsapp);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    z-index: 1040;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.floating-whatsapp-btn:hover,
.floating-whatsapp-btn:active {
    transform: scale(1.08);
    color: #fff;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.55);
}

/* Valuation Result Box */
.valuation-result-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #93c5fd;
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
}
.valuation-price {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary-dark);
    margin: 15px 0;
}

/* Footer */
footer {
    background: var(--secondary);
    color: #cbd5e1;
    padding: 60px 0 20px;
    font-size: 0.95rem;
}
footer a {
    color: #94a3b8;
}
footer a:hover {
    color: #ffffff;
}
footer h5 {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ==================================================
   MOBILE OPTIMIZATIONS (< 992px & < 768px)
   ================================================== */

@media (max-width: 1199.98px) {
    /* Navbar Mobile Styles */
    .navbar {
        padding: 8px 0;
    }
    .header-logo {
        height: 36px;
        max-width: 170px;
    }
    .navbar-collapse {
        background: #ffffff;
        border-radius: 16px;
        padding: 16px;
        margin-top: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.12);
        border: 1px solid var(--card-border);
    }
    .navbar-nav .nav-link {
        padding: 12px 14px !important;
        border-bottom: 1px solid #f1f5f9;
        font-size: 1rem;
        display: flex;
        align-items: center;
    }
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

@media (max-width: 767.98px) {
    /* Prevent iOS Safari 16px auto-zoom */
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Hero Section Mobile */
    .hero-section {
        padding: 36px 0 44px;
        text-align: center;
    }
    .hero-title {
        font-size: 1.85rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    .hero-subtitle {
        font-size: 1.05rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
        padding: 0 4px;
    }
    .hero-badge {
        font-size: 0.8rem;
        padding: 5px 12px;
        margin-bottom: 1rem;
        white-space: normal;
        text-align: center;
        line-height: 1.4;
    }
    .btn-primary-custom,
    .btn-whatsapp {
        padding: 12px 20px;
        font-size: 1rem;
    }

    /* Lead Form Wizard Mobile */
    .lead-form-card {
        padding: 20px 14px;
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    }
    .lead-form-card h4 {
        font-size: 1.2rem;
    }
    .step-progress-bar {
        height: 5px;
        margin-bottom: 18px;
    }
    .form-step h5 {
        font-size: 1.05rem;
        line-height: 1.4;
    }
    .option-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 12px;
    }
    .option-grid.chips-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .option-label {
        padding: 12px 6px;
        font-size: 0.88rem;
        min-height: 52px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        touch-action: manipulation;
        -webkit-user-select: none;
        user-select: none;
    }
    .chips-grid .option-label {
        padding: 10px 4px;
        font-size: 0.82rem;
        min-height: 48px;
    }
    .option-label:active {
        transform: scale(0.97);
    }
    .option-label i {
        font-size: 1.25rem !important;
        margin-bottom: 3px !important;
    }

    /* Upload dropzone on mobile */
    .upload-dropzone {
        padding: 22px 12px;
        border-radius: 12px;
    }
    .upload-dropzone h6 {
        font-size: 0.95rem;
    }
    .upload-dropzone p {
        font-size: 0.8rem;
    }
    .preview-thumb {
        width: 70px;
        height: 70px;
    }

    /* Navigation buttons in Wizard */
    #prevStepBtn,
    #nextStepBtn,
    #submitLeadBtn {
        padding: 11px 20px !important;
        font-size: 0.95rem;
        min-height: 46px;
    }

    /* Valuation Calculator Mobile */
    .valuation-result-box {
        padding: 20px 14px;
        border-radius: 14px;
    }
    .valuation-price {
        font-size: 1.7rem;
    }

    /* Cards & Spacing */
    .feature-card {
        padding: 18px;
    }
    .feature-icon {
        width: 46px;
        height: 46px;
        font-size: 1.25rem;
        margin-bottom: 12px;
    }
    footer {
        padding: 40px 0 20px;
    }
}
