/* ==========================================================================
   CSS Reset & Variables
   ========================================================================== */
:root {
    --primary: #33A1E0;
    --secondary: #1e3a8a;
    --accent: #f3f4f6;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --white: #ffffff;
    --border-color: #e5e7eb;
    
    --font-main: 'Tajawal', sans-serif;
    
    --transition-fast: 0.2s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
    --transition-slow: 0.5s ease-in-out;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, textarea {
    font-family: inherit;
}

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.font-bold { font-weight: 700; }

.bg-white { background-color: var(--white); }
.bg-accent { background-color: var(--accent); }

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
}

/* ==========================================================================
   Layout & Utilities
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.glassmorphism {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.glassmorphism.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #f8fafc;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    transition: var(--transition-normal);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--secondary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: var(--white);
    color: var(--secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
    border-radius: 0.75rem;
    padding: 1rem;
}

.btn-text {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-normal);
}

.btn-text:hover {
    color: var(--secondary);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    padding: 1rem 0;
    transition: var(--transition-normal);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 3rem;
    width: auto;
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 2rem;
}

.desktop-nav a {
    color: var(--text-muted);
    font-weight: 700;
    transition: var(--transition-fast);
}

.desktop-nav a:hover {
    color: var(--primary);
}

.mobile-menu-btn {
    display: block;
    font-size: 1.5rem;
    color: var(--text-muted);
    z-index: 51;
    position: relative;
}

.mobile-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out;
    pointer-events: none;
    border-top: 1px solid var(--border-color);
}

.mobile-dropdown.is-open {
    max-height: 400px;
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0;
    gap: 1.5rem;
}

.mobile-link {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
    transition: var(--transition-fast);
}

.mobile-link:hover {
    color: var(--primary);
}

@media (min-width: 768px) {
    .desktop-nav { display: flex; }
    .mobile-menu-btn { display: none; }
    .mobile-dropdown { display: none !important; }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    position: relative;
    padding: 8rem 0 5rem;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .hero-section {
        padding: 12rem 0 8rem;
    }
}

.hero-bg-shapes {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.1;
    mix-blend-mode: multiply;
}

.shape-1 {
    top: -5rem;
    right: -5rem;
    width: 24rem;
    height: 24rem;
    background-color: var(--primary);
}

.shape-2 {
    top: 10rem;
    left: -5rem;
    width: 18rem;
    height: 18rem;
    background-color: var(--secondary);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) { .hero-title { font-size: 3.75rem; } }
@media (min-width: 1024px) { .hero-title { font-size: 4.5rem; } }

.typewriter-cursor {
    color: #9ca3af;
    animation: pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) { .hero-subtitle { font-size: 1.5rem; } }

.hero-buttons {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .hero-buttons {
        flex-direction: row;
    }
}

/* ==========================================================================
   Sections General
   ========================================================================== */
.why-us-section, .services-section {
    padding: 6rem 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 1.875rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

@media (min-width: 768px) { .section-header h2 { font-size: 3rem; } }

.section-divider {
    width: 6rem;
    height: 0.25rem;
    background-color: var(--primary);
    margin: 0 auto;
    border-radius: 9999px;
}

.section-header p {
    color: var(--text-muted);
    margin-top: 1.5rem;
    font-size: 1.125rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

/* Grid Layouts */
.features-grid, .services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .features-grid, .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   Cards (Why Us)
   ========================================================================== */
.feature-card {
    background-color: var(--accent);
    border-radius: 1.5rem;
    padding: 2.5rem;
    text-align: center;
    border: 1px solid transparent;
    transition: var(--transition-normal);
}

.feature-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-0.5rem);
    border-color: var(--border-color);
}

.feature-icon {
    width: 5rem;
    height: 5rem;
    background-color: var(--white);
    color: var(--primary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-md);
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-muted);
}

/* ==========================================================================
   Cards (Services)
   ========================================================================== */
.service-card {
    background-color: var(--white);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    box-shadow: var(--shadow-xl);
}

.service-hover-border {
    position: absolute;
    top: 0;
    right: 0;
    width: 0.5rem;
    height: 100%;
    background-color: var(--primary);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}

.service-card:hover .service-hover-border {
    transform: scaleY(1);
}

.service-icon {
    font-size: 3.75rem;
    color: var(--primary);
    margin-bottom: 2rem;
    opacity: 0.9;
    transition: var(--transition-normal);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 1.875rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: var(--secondary);
    color: var(--white);
    padding-top: 5rem;
    padding-bottom: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }

.footer-logo {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.footer-logo span {
    color: var(--primary);
}

.footer-desc {
    color: #9ca3af;
    line-height: 1.7;
}

.footer-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--white);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #9ca3af;
    display: block;
    transition: var(--transition-fast);
}

.footer-links:not(.no-hover) a:hover {
    color: var(--white);
    transform: translateX(-0.5rem);
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: #9ca3af;
    margin-bottom: 1.25rem;
}

.footer-contact i {
    color: var(--primary);
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.contact-phones {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-phones a {
    transition: var(--transition-fast);
}

.contact-phones a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-links a {
    width: 3rem;
    height: 3rem;
    background-color: #1f2937;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition-normal);
}

.social-links a:hover {
    background-color: var(--primary);
    transform: scale(1.1);
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    text-align: center;
    color: #6b7280;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 58, 138, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--white);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 32rem;
    padding: 2.5rem;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem; /* left for RTL */
    font-size: 1.5rem;
    color: #9ca3af;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-content h3 {
    font-size: 1.875rem;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background-color: #f9fafb;
    border: 1px solid var(--border-color);
    outline: none;
    transition: var(--transition-fast);
    resize: none;
}

.form-group input:focus, .form-group textarea:focus {
    background-color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(51, 161, 224, 0.2);
}

/* ==========================================================================
   Floating Elements
   ========================================================================== */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 50;
    background-color: #25D366;
    color: var(--white);
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    box-shadow: 0 4px 20px rgba(37,211,102,0.4);
    transition: var(--transition-normal);
}

.whatsapp-float:hover {
    box-shadow: 0 8px 30px rgba(37,211,102,0.6);
    transform: scale(1.1);
}

.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 50;
    background-color: var(--secondary);
    color: var(--white);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(2.5rem);
    transition: var(--transition-normal);
}

.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background-color: var(--primary);
    box-shadow: var(--shadow-xl);
}

/* ==========================================================================
   Animations (Intersection Observer)
   ========================================================================== */
.animate-on-scroll {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, visibility 0.8s;
    will-change: opacity, transform, visibility;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* Fade Up */
.fade-up {
    transform: translateY(50px);
}

/* Delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }