/* ==========================================================================
   Custom CSS for Web Design Agency Website
   ========================================================================== */

/* ── AOS Fallback ─────────────────────────────────────────────────────────────
   If AOS library fails to load (CDN blocked, offline), elements with data-aos
   attributes will stay at opacity: 0 forever. This ensures they are always
   visible as a fallback.
   ──────────────────────────────────────────────────────────────────────────── */
html:not(.aos-initialized) [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* Typography & Colors */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #e0e7ff;
    --secondary: #64748b;
    --dark: #0f172a;
    --light: #f8fafc;
    --white: #ffffff;
    --black: #000000;
}

html {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Cairo', sans-serif;
    color: #334155;
    background-color: var(--white);
    max-width: 100%;
    overflow-x: hidden;
}

/* Utilities */
.font-sans {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

.font-cairo {
    font-family: 'Cairo', sans-serif !important;
}

.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.badge-strategic {
    background-color: rgba(79, 70, 229, 0.1) !important;
    color: var(--primary) !important;
    white-space: normal !important;
    word-wrap: break-word;
    max-width: 100%;
    line-height: 1.4;
    text-align: start;
    display: inline-block;
}

[data-bs-theme="dark"] .badge-strategic {
    background-color: rgba(129, 140, 248, 0.15) !important;
    color: #818cf8 !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tracking-wide {
    letter-spacing: 0.1em;
}

/* Navigation (Glassmorphism) */
.custom-navbar {
    background-color: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding-top: 0.25rem;
    /* Reduced padding to fit larger logo */
    padding-bottom: 0.25rem;
    transition: all 0.4s ease-in-out;
}

.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.nav-link {
    font-weight: 600;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

/* ==========================================================================
   Modern Navbar Controls (Language & Theme Toggles)
   ========================================================================== */
.lang-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: 42px;
    padding: 0.35rem 0.95rem;
    border-radius: 50px;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.lang-toggle-btn .lang-globe-icon {
    font-size: 0.95rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.lang-toggle-btn:hover {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: var(--primary);
    box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.12);
    transform: translateY(-1px);
}

.lang-toggle-btn:hover .lang-globe-icon {
    transform: rotate(20deg) scale(1.1);
}

.lang-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.lang-toggle-mobile {
    height: 38px !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.85rem !important;
}

/* Theme Toggle Button Refinement */
.theme-toggle-btn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background-color: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    color: #1e293b !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.theme-toggle-btn:hover {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: var(--primary) !important;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.12) !important;
    transform: translateY(-1px);
}

.theme-toggle-btn:active {
    transform: translateY(0) !important;
}

.theme-toggle-mobile {
    width: 38px !important;
    height: 38px !important;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.btn-outline-dark {
    transition: all 0.3s ease;
}

.btn-hover-effect {
    transition: all 0.3s ease-in-out;
}

.btn-hover-effect:active {
    transform: translateY(1px);
}

/* Background Gradients & Blobs */
.hero-section {
    background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.05), transparent 40%),
        radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.05), transparent 40%);
}

.blob-shape {
    transition: all 4s ease-in-out infinite alternate;
    animation: flow 8s ease-in-out infinite;
}

@keyframes flow {
    0% {
        transform: scale(1) translate(0, 0);
    }

    33% {
        transform: scale(1.1) translate(30px, -50px);
    }

    66% {
        transform: scale(0.9) translate(-20px, 20px);
    }

    100% {
        transform: scale(1) translate(0, 0);
    }
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Service Cards */
.service-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1) !important;
    background-color: var(--white) !important;
}

.service-card .icon-box {
    transition: all 0.4s;
}

.service-card:hover .icon-box {
    background-color: var(--primary) !important;
    color: var(--white) !important;
    transform: scale(1.1) rotate(5deg);
}

/* Portfolio Hover Effects */
.portfolio-item {
    cursor: pointer;
}

.portfolio-img {
    transition: transform 0.8s ease;
}

.portfolio-overlay {
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.4) 50%, transparent 100%);
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: all 0.4s ease-in-out;
}

.portfolio-item:hover .portfolio-img {
    transform: scale(1.08);
}

/* Portfolio Carousel Wrapper & Arrow Buttons */
.portfolio-wrapper {
    position: relative;
    padding: 0 45px;
}

@media (max-width: 767.98px) {
    .portfolio-wrapper {
        padding: 0;
    }
}

.portfolio-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    z-index: 20;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--dark) !important;
    border-radius: 50%;
}

.portfolio-arrow:hover {
    background-color: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* LTR layout positions */
html[dir="ltr"] .portfolio-arrow-prev {
    left: -15px;
}
html[dir="ltr"] .portfolio-arrow-next {
    right: -15px;
}

/* RTL layout positions */
html[dir="rtl"] .portfolio-arrow-prev {
    right: -15px;
}
html[dir="rtl"] .portfolio-arrow-next {
    left: -15px;
}

/* RTL icon direction inversion */
html[dir="rtl"] .portfolio-arrow i {
    transform: rotate(180deg);
}

[data-bs-theme="dark"] .portfolio-arrow {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .portfolio-arrow:hover {
    background-color: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.portfolio-link {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Pricing Cards & Premium Layout */
.pricing-wrapper {
    position: relative;
    padding: 0;
}

@media (min-width: 992px) {
    /* Hide navigation arrows on desktop since all 4 columns are visible */
    .pricing-arrow {
        display: none !important;
    }
}

/* Modern Mobile-Friendly Tabbed Pricing Cards */
.pricing-column {
    display: flex;
    transition: all 0.4s ease;
}

.pricing-card-v2 {
    background: rgba(30, 41, 59, 0.45) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px !important;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    color: #e2e8f0 !important;
    padding: 32px 24px !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.pricing-card-v2:hover {
    transform: translateY(-8px) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.4) !important;
}

/* Card Top Accent Bar */
.card-accent-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    border-radius: 24px 24px 0 0;
}

.accent-startup { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.accent-growth { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.accent-pro { background: linear-gradient(90deg, #4f46e5, #a855f7); }
.accent-enterprise { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

/* Highlight Featured Card */
.pricing-card-v2.featured-card {
    border-color: rgba(129, 140, 248, 0.4) !important;
    background: rgba(30, 41, 59, 0.6) !important;
    box-shadow: 0 20px 40px -10px rgba(79, 70, 229, 0.15) !important;
}

.pricing-card-v2.featured-card:hover {
    border-color: rgba(129, 140, 248, 0.7) !important;
    box-shadow: 0 30px 60px -10px rgba(79, 70, 229, 0.3) !important;
}

/* Price Box */
.pricing-card-v2 .price-display {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pricing-card-v2 .text-muted,
.pricing-card-v2 p {
    color: #94a3b8 !important;
}

.pricing-card-v2 li {
    color: #cbd5e1 !important;
}

/* Checkmarks */
.pricing-card-v2 .check-icon-v2 {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.pricing-card-v2 .check-icon-v2.check-success {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

.pricing-card-v2 .check-icon-v2.check-warning {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

/* Premium Badge */
.featured-badge-v2 {
    background: linear-gradient(90deg, #4f46e5, #a855f7);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

/* Mobile Switcher */
.pricing-mobile-switcher {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pricing-mobile-switcher button {
    border: none;
    background: transparent;
    transition: all 0.3s ease;
}

.pricing-mobile-switcher button.active {
    background: linear-gradient(90deg, #4f46e5, #a855f7) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

@media (max-width: 991.98px) {
    .pricing-column:not(.mobile-active) {
        display: none !important;
    }
    .pricing-column.mobile-active {
        display: flex !important;
    }
}

/* Forms & Inputs */
.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25);
    border-color: var(--primary) !important;
    background-color: var(--white) !important;
}

.form-control {
    border: 1px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

/* ==========================================================================
   Modern Minimalist Contact Section Styles (Underline / Line-Only Inputs)
   ========================================================================== */
.contact-section {
    position: relative;
    background-color: #f8fafc;
}

.contact-form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 24px !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04) !important;
}

.contact-form-card .card-body {
    padding: 3.5rem 3rem !important;
}

.contact-method-card {
    background: #ffffff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    padding: 1.25rem 1.45rem !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-method-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.08) !important;
}

#contact .form-label {
    padding-inline-start: 0.15rem;
    margin-bottom: 0.45rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
    display: block;
}

/* Minimalist Underline / Bottom-Line Only Input Fields (Spacious Size) */
.modern-input {
    background-color: transparent !important;
    border: none !important;
    border-bottom: 2px solid #cbd5e1 !important;
    border-radius: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    padding: 0.85rem 0.35rem !important;
    min-height: 52px;
    box-shadow: none !important;
    transition: all 0.25s ease-in-out !important;
}

.modern-input::placeholder {
    color: #94a3b8 !important;
    font-weight: 400 !important;
    font-size: 0.95rem !important;
}

.modern-input:hover {
    border-bottom-color: #64748b !important;
}

.modern-input:focus {
    border-bottom-color: #4f46e5 !important;
    background-color: transparent !important;
    box-shadow: 0 2px 0 0 #4f46e5 !important;
    outline: none !important;
}

textarea.modern-input {
    border-radius: 0 !important;
    min-height: 145px !important;
    padding: 0.85rem 0.35rem !important;
    line-height: 1.6 !important;
    resize: none !important;
}

/* Modern Refined Submit Button (Prominent Size) */
.modern-submit-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    border-radius: 12px !important;
    height: 54px !important;
    padding: 0.85rem 2rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    box-shadow: 0 10px 25px -4px rgba(79, 70, 229, 0.4) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.modern-submit-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 14px 28px -4px rgba(79, 70, 229, 0.5) !important;
    color: #ffffff !important;
}

.modern-submit-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.25) !important;
}

.modern-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Footer Focus */
.footer-link {
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--primary) !important;
    opacity: 1 !important;
    padding-right: 8px;
    /* For RTL hover push */
}

/* Prevent horizontal scroll issue on mobile with row */
.row {
    margin-right: 0;
    margin-left: 0;
}

/* ==========================================================================
   Dark Mode Overrides
   ========================================================================== */
[data-bs-theme="dark"] {
    --primary-light: #3730a3;
    --dark: #f8fafc;
    --light: #000000;
    --white: #111111;
    --black: #ffffff;
}

[data-bs-theme="dark"] body {
    background-color: #000000;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .custom-navbar {
    background-color: rgba(0, 0, 0, 0.75) !important;
}

[data-bs-theme="dark"] .navbar-scrolled {
    background-color: rgba(0, 0, 0, 0.95) !important;
}

[data-bs-theme="dark"] .glass-card {
    background: rgba(17, 17, 17, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .text-dark {
    color: var(--dark) !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: var(--white) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: var(--light) !important;
}

[data-bs-theme="dark"] .theme-toggle-btn {
    background: #334155 !important;
    border-color: #475569 !important;
}

[data-bs-theme="dark"] .theme-toggle-btn i {
    color: #facc15 !important;
    /* Yellow sun */
}

/* Base image handling for dark mode -> dimming or blending if necessary */
[data-bs-theme="dark"] img {
    opacity: 0.9;
}

.portfolio-row > [class*="col-"] {
    flex-shrink: 0 !important;
}

/* Custom smooth scrolling & hide scrollbar for mobile carousels */
@media (max-width: 767.98px) {
    .portfolio-row {
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .portfolio-row > [class*="col-"] {
        scroll-snap-align: start;
    }
}

.scrollbar-hidden::-webkit-scrollbar {
    display: none;
}

.scrollbar-hidden {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Pricing Slider / Carousel Styles */
.pricing-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    z-index: 20;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--dark) !important;
    border-radius: 50%;
}

.pricing-arrow:hover {
    background-color: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* LTR layout positions */
html[dir="ltr"] .pricing-arrow-prev {
    left: -15px;
}
html[dir="ltr"] .pricing-arrow-next {
    right: -15px;
}

/* RTL layout positions */
html[dir="rtl"] .pricing-arrow-prev {
    right: -15px;
}
html[dir="rtl"] .pricing-arrow-next {
    left: -15px;
}

/* RTL icon direction inversion */
html[dir="rtl"] .pricing-arrow i {
    transform: rotate(180deg);
}

[data-bs-theme="dark"] .pricing-arrow {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .pricing-arrow:hover {
    background-color: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* On mobile/tablet screens: pricing cards are stacked vertically for a clean, fully readable layout */
@media (max-width: 991.98px) {
    /* Hide navigation arrows completely */
    .portfolio-arrow,
    .pricing-arrow {
        display: none !important;
    }

    .pricing-row {
        flex-direction: column !important;
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        gap: 30px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .pricing-row > [class*="col-"] {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    /* Normalize card scale and margins on mobile viewports */
    .pricing-row .pricing-card {
        transform: none !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        width: 100% !important;
    }
    
    /* Ensure the featured card stands out beautifully in the stack */
    .pricing-row .pricing-card-featured {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }
}

/* ==========================================================================
   Dark Mode — Full Content Section Overrides
   ========================================================================== */

/* Cards & Surfaces */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .service-card,
[data-bs-theme="dark"] .pricing-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .service-card:hover {
    background-color: #253248 !important;
}

/* Force text visibility in dark mode */
[data-bs-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] p,
[data-bs-theme="dark"] span,
[data-bs-theme="dark"] li {
    color: inherit;
}

/* Hero & Section Backgrounds */
[data-bs-theme="dark"] .hero-section,
[data-bs-theme="dark"] section.bg-light,
[data-bs-theme="dark"] .bg-light {
    background-color: #0f172a !important;
}

[data-bs-theme="dark"] section.bg-white,
[data-bs-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}

/* Pricing section stays dark but readable */
[data-bs-theme="dark"] section.bg-dark {
    background-color: #020617 !important;
}

/* Pricing card text in dark mode */
[data-bs-theme="dark"] .pricing-card .text-dark,
[data-bs-theme="dark"] .pricing-card .text-muted,
[data-bs-theme="dark"] .pricing-card span {
    color: #cbd5e1 !important;
}

/* Contact section dark mode */
[data-bs-theme="dark"] .contact-section {
    background-color: #0b0f19 !important;
}

[data-bs-theme="dark"] .contact-form-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95)) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.6) !important;
}

[data-bs-theme="dark"] .contact-method-card {
    background: rgba(30, 41, 59, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .contact-method-card:hover {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
}

[data-bs-theme="dark"] #contact .form-label {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .modern-input {
    background-color: transparent !important;
    border-bottom: 2px solid #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .modern-input::placeholder {
    color: rgba(148, 163, 184, 0.5) !important;
}

[data-bs-theme="dark"] .modern-input:hover {
    border-bottom-color: #64748b !important;
}

[data-bs-theme="dark"] .modern-input:focus {
    border-bottom-color: #818cf8 !important;
    box-shadow: 0 2px 0 0 #818cf8 !important;
}

[data-bs-theme="dark"] .contact-method-card {
    background-color: #1e293b !important;
}

/* Forms */
[data-bs-theme="dark"] .form-control {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

[data-bs-theme="dark"] .form-label {
    color: #94a3b8 !important;
}

/* Footer remains dark */
[data-bs-theme="dark"] .footer {
    background-color: #000000 !important;
}

/* Badge & icon box overrides */
[data-bs-theme="dark"] .icon-box {
    background-color: #1e293b !important;
}

/* Navbar mobile collapse in dark mode */
@media (max-width: 991.98px) {
    [data-bs-theme="dark"] .navbar-collapse {
        background-color: rgba(15, 23, 42, 0.98) !important;
    }
}

[data-bs-theme="dark"] .navbar-collapse .nav-link,
[data-bs-theme="dark"] .navbar-collapse a {
    color: #e2e8f0 !important;
}

/* Alert boxes in dark mode */
[data-bs-theme="dark"] .alert-success {
    background-color: #166534;
    color: #bbf7d0;
    border-color: #15803d;
}

[data-bs-theme="dark"] .alert-danger {
    background-color: #7f1d1d;
    color: #fecaca;
    border-color: #991b1b;
}

/* Floating stat card */
[data-bs-theme="dark"] .floating-stat-card {
    background-color: #1e293b !important;
}

/* Gradient text stays readable */
[data-bs-theme="dark"] .text-gradient {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Step circles in methodology section */
[data-bs-theme="dark"] .col-md-6.col-lg-3 .bg-white,
[data-bs-theme="dark"] .col-md-6.col-lg-3 .rounded-circle {
    background-color: #1e293b !important;
    color: #818cf8 !important;
}

/* Badge bg-primary in dark mode */
[data-bs-theme="dark"] .badge.bg-primary {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

/* Dark Mode Overrides for Navbar Controls */
[data-bs-theme="dark"] .lang-toggle-btn {
    background-color: rgba(30, 41, 59, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .lang-toggle-btn .lang-globe-icon {
    color: #818cf8 !important;
}

[data-bs-theme="dark"] .lang-toggle-btn:hover {
    background-color: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(129, 140, 248, 0.4) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .theme-toggle-btn {
    background-color: rgba(30, 41, 59, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #facc15 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .theme-toggle-btn:hover {
    background-color: rgba(30, 41, 59, 0.95) !important;
    border-color: rgba(250, 204, 21, 0.4) !important;
    color: #fef08a !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

/* Custom outline button styles with explicit hover state handling */
.btn-outline-dark {
    color: var(--dark) !important;
    border-color: var(--dark) !important;
    background-color: transparent !important;
    transition: all 0.3s ease !important;
}

.btn-outline-dark:hover {
    color: var(--white) !important;
    background-color: var(--dark) !important;
    border-color: var(--dark) !important;
}

[data-bs-theme="dark"] .btn-outline-dark {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-outline-dark:hover {
    color: #000000 !important;
    background-color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Prevent horizontal overflow on sections */
#pricing, #portfolio, #services, #contact, .hero-section, footer {
    overflow-x: hidden !important;
}

/* Ensure fixed navbar container is bounded */
.fixed-top {
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
}

/* ── Mobile Layout & Typography Optimizations (< 768px) ────────────────────── */
@media (max-width: 767.98px) {
    /* 1. Viewport & Margins: Consistent outer layout padding of 20px */
    section, footer, header, .container, .container-fluid {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    /* 2. Arabic Typography & Readability: Decrease H1 size and set line-height to 1.6 */
    .hero-section h1 {
        font-size: 2rem !important;
        line-height: 1.5 !important;
    }

    /* Target all Arabic text elements to at least 1.6 line-height */
    html[lang="ar"] body,
    html[lang="ar"] p,
    html[lang="ar"] h1,
    html[lang="ar"] h2,
    html[lang="ar"] h3,
    html[lang="ar"] h4,
    html[lang="ar"] h5,
    html[lang="ar"] h6,
    html[lang="ar"] li,
    html[lang="ar"] a,
    html[lang="ar"] span {
        line-height: 1.65 !important;
    }

    /* 3. Button Hierarchy & Layout: Convert CTA wrapper to vertical stack, full-width buttons */
    .hero-btns {
        flex-direction: column !important;
        gap: 16px !important;
    }

    .hero-btns .btn {
        width: 100% !important;
        justify-content: center !important;
        padding-top: 14px !important;
        padding-bottom: 14px !important;
    }

    /* 4. Header Real Estate: Clean navbar flex layout, prevent wrapping, and reduce sizes to fit */
    .custom-navbar {
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .custom-navbar .navbar-brand {
        gap: 6px !important;
    }
    
    .custom-navbar .navbar-brand img {
        height: 32px !important;
    }
    
    .custom-navbar .navbar-brand span {
        font-size: 1.15rem !important;
        letter-spacing: 0.5px !important;
    }
    
    .custom-navbar .d-flex.d-lg-none {
        gap: 12px !important; /* Balanced gap between controls */
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .custom-navbar .d-flex.d-lg-none .btn-outline-dark {
        padding-left: 10px !important;
        padding-right: 10px !important;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
        font-size: 0.75rem !important;
    }
    
    .custom-navbar .d-flex.d-lg-none .theme-toggle-btn {
        width: 36px !important;
        height: 36px !important;
    }
    
    .custom-navbar .d-flex.d-lg-none .theme-toggle-btn i {
        font-size: 0.9rem !important;
    }
    
    .custom-navbar .d-flex.d-lg-none .navbar-toggler span {
        font-size: 1.6rem !important;
    }

    /* 5. Mobile Screen Filling & Proportional Design Optimization */
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Proportional Sleek Hero Buttons on Mobile */
    .hero-btns {
        width: 100% !important;
        max-width: 330px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .hero-btns .btn {
        width: 100% !important;
        height: 48px !important;
        padding: 0.65rem 1.25rem !important;
        font-size: 0.95rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

    /* Pricing / Package Section Card on Mobile */
    #pricing .featured-card {
        padding: 1.25rem 1rem !important;
        border-radius: 1.25rem !important;
    }

    #pricing .badge {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.75rem !important;
    }

    #pricing .price-display {
        padding: 0.85rem 0.75rem !important;
        margin-top: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }

    #pricing .price-display .display-4 {
        font-size: 2.25rem !important;
    }

    #pricing .btn {
        height: 48px !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.95rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

    /* Contact Form & Inputs Optimization */
    #contact .card-body {
        padding: 1.5rem 1.15rem !important;
    }

    #contact .modern-input {
        border-radius: 0 !important;
        font-size: 16px !important; /* Prevents iOS/mobile auto-zoom */
        padding: 0.65rem 0.25rem !important;
    }

    #contact textarea.modern-input {
        border-radius: 0 !important;
        padding: 0.65rem 0.25rem !important;
    }

    #contact .modern-submit-btn {
        width: 100% !important;
        height: 50px !important;
        font-size: 1rem !important;
        border-radius: 12px !important;
    }

    .service-card {
        padding: 1.5rem 1.25rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #view-all-services-container .btn {
        width: 100% !important;
        height: 48px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #services .row, #portfolio .row {
        margin-left: -6px !important;
        margin-right: -6px !important;
    }

    #services [class*="col-"], #portfolio [class*="col-"] {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
}