/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* ========================================
   TABLET & BELOW (992px and down)
   ======================================== */
@media (max-width: 992px) {

    /* Container */
    .container {
        width: 95%;
        padding: 0 15px;
    }

    /* Section Titles */
    .section-title {
        font-size: 2rem;
    }

    .section-intro {
        font-size: 1rem;
        margin: -1.5rem auto 2.5rem;
    }

    /* Reduce Padding */
    .services,
    .why-us,
    .ai-lab {
        padding: 4rem 0;
    }
}

/* ========================================
   MOBILE (768px and down)
   ======================================== */
@media (max-width: 768px) {

    /* Typography */
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2.5rem;
    }

    .section-intro {
        font-size: 0.95rem;
        margin: -1rem auto 2rem;
        padding: 0 10px;
    }

    /* Reduce Section Padding */
    .services,
    .why-us,
    .ai-lab {
        padding: 3rem 0;
    }

    /* Hero Section */
    .hero {
        padding: 5rem 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

/* ========================================
   SMALL MOBILE (576px and down)
   ======================================== */
@media (max-width: 576px) {

    /* Container */
    .container {
        width: 100%;
        padding: 0 10px;
    }

    /* Typography */
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .section-title::after {
        width: 40px;
        height: 2px;
        margin: 10px auto 0;
    }

    .section-intro {
        font-size: 0.9rem;
        margin: -0.5rem auto 1.5rem;
    }

    /* Why Us Cards */
    .why-us-card {
        padding: 0.75rem;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .feature-content h3 {
        font-size: 1.1rem;
    }

    .feature-content p {
        font-size: 0.85rem;
    }

    /* AI Lab Cards */
    .ai-lab-card {
        padding: 1.5rem 1rem;
    }

    .ai-lab-card .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .ai-lab-card h3 {
        font-size: 1.2rem;
    }

    .ai-lab-card p {
        font-size: 0.9rem;
    }

    /* Reduce Section Padding */
    .services,
    .why-us,
    .ai-lab {
        padding: 2.5rem 0;
    }

    /* Hero Section */
    .hero {
        padding: 4rem 0;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero p {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .btn {
        padding: 12px 30px;
        font-size: 0.85rem;
        letter-spacing: 1px;
    }
}

/* ========================================
   RTL MOBILE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
    body[dir="rtl"] .why-us-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    body[dir="rtl"] .why-us-card:hover {
        transform: translateY(-5px);
    }

    body[dir="rtl"] .feature-content {
        text-align: center;
    }
}

/* ========================================
   FIX GRID OVERFLOW ON SMALL SCREENS
   ======================================== */
@media (max-width: 480px) {

    .services-grid,
    .why-us-grid,
    .ai-lab-grid {
        gap: 1rem;
    }

    .service-card,
    .why-us-card,
    .ai-lab-card {
        min-width: 0;
        /* Prevent grid overflow */
    }
}

/* ========================================
   IMPROVE TOUCH TARGETS FOR MOBILE
   ======================================== */
@media (max-width: 768px) {

    .service-card,
    .why-us-card,
    .ai-lab-card {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(90, 15, 27, 0.1);
    }

    /* Increase tap area for links */
    .service-card a,
    .ai-lab-card a {
        min-height: 44px;
        /* iOS recommended touch target */
    }
}

/* ========================================
   PREVENT HORIZONTAL SCROLL
   ======================================== */
body {
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   IMPROVE READABILITY ON MOBILE
   ======================================== */
@media (max-width: 576px) {
    body {
        font-size: 16px;
        /* Prevent iOS zoom on input focus */
    }

    p {
        line-height: 1.7;
    }

    h3 {
        line-height: 1.4;
    }
}