/* ========================================
   MOBILE RESPONSIVE STYLES & ANIMATIONS
   ======================================== */

/* Mobile-First Responsive Breakpoints */
:root {
    --mobile-padding: 1rem;
    --tablet-padding: 2rem;
    --desktop-padding: 3rem;
}

/* Global Overflow Safety */
html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    max-width: 100vw;
}

/* ========================================

/* ========================================
   MOBILE NAVIGATION
   ======================================== */

@media (max-width: 768px) {

    /* Mobile Menu - UPDATED selector to match HTML (.nav-menu) */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s ease;
        z-index: 999;
        overflow-y: auto;
        display: flex;
        /* Ensure flex layout */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        left: 0;
        animation: slideInLeft 0.3s ease;
    }

    .nav-menu li {
        margin: 1rem 0;
        opacity: 0;
        animation: fadeInUp 0.3s ease forwards;
        width: 100%;
        text-align: center;
    }

    .nav-menu.active li:nth-child(1) {
        animation-delay: 0.1s;
    }

    .nav-menu.active li:nth-child(2) {
        animation-delay: 0.2s;
    }

    .nav-menu.active li:nth-child(3) {
        animation-delay: 0.3s;
    }

    .nav-menu.active li:nth-child(4) {
        animation-delay: 0.4s;
    }

    .nav-menu.active li:nth-child(5) {
        animation-delay: 0.5s;
    }

    .nav-menu.active li:nth-child(6) {
        animation-delay: 0.6s;
    }

    .nav-menu a {
        font-size: 1.2rem;
        padding: 1rem;
        display: block;
        border-radius: var(--radius-md);
        transition: all 0.3s ease;
        color: var(--text-dark);
        text-decoration: none;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        background: var(--gradient-primary);
        color: white;
        transform: translateX(10px);
    }

    /* Hamburger Menu - UPDATED selector to match HTML (.mobile-toggle) */
    .mobile-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        z-index: 1000;
        width: 30px;
        height: 25px;
        justify-content: space-between;
    }

    .mobile-toggle span {
        width: 100%;
        height: 3px;
        background: var(--primary-color);
        transition: all 0.3s ease;
        border-radius: 3px;
        transform-origin: left;
    }

    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg);
    }

    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg);
    }
}

/* ========================================
   MOBILE TYPOGRAPHY
   ======================================== */

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    h5 {
        font-size: 1.1rem;
    }

    .hero-title {
        font-size: 2.2rem !important;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem !important;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 1.8rem !important;
    }

    .hero-subtitle {
        font-size: 1rem !important;
    }
}

/* ========================================
   MOBILE CONTAINERS & SPACING
   ======================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 var(--mobile-padding);
        max-width: 100%;
    }

    section {
        padding: 3rem 0;
    }

    .section-title {
        margin-bottom: 2rem;
    }
}

/* ========================================
   MOBILE GRID LAYOUTS
   ======================================== */

@media (max-width: 768px) {

    /* MOBILE GRID LAYOUTS - FORCED SINGLE COLUMN */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 100% !important;
        /* Force full width single column */
        gap: 1.5rem;
        display: grid !important;
    }
}

/* Two columns for tablets */
@media (min-width: 480px) and (max-width: 768px) {

    .grid-2,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ========================================
   MOBILE CARDS
   ======================================== */

@media (max-width: 768px) {
    .card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .card:hover {
        transform: translateY(-5px);
    }

    .service-card,
    .job-card,
    .blog-card,
    .testimonial-card {
        margin-bottom: 1.5rem;
    }

    /* Stack card content vertically */
    .card-content {
        flex-direction: column;
    }

    .card-icon,
    .icon-box {
        margin-bottom: 1rem;
    }
}

/* ========================================
   MOBILE BUTTONS
   ======================================== */

@media (max-width: 768px) {
    .btn {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
        width: 100%;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .btn-group {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-group .btn {
        width: 100%;
    }

    /* Touch-friendly sizing */
    .btn,
    a,
    button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ========================================
   MOBILE FORMS
   ======================================== */

@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1.25rem;
    }

    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 1rem;
    }

    .form-row {
        flex-direction: column;
        gap: 1.25rem;
    }

    .file-upload {
        padding: 2rem 1rem;
    }
}

/* ========================================
   MOBILE HERO SECTION
   ======================================== */

@media (max-width: 768px) {
    .hero {
        min-height: 70vh;
        padding: 4rem 0 3rem;
        text-align: center;
    }

    .hero-content {
        padding: 2rem 1rem;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    /* Reduce orb size on mobile */
    .orb-1,
    .orb-2 {
        width: 200px;
        height: 200px;
    }

    .decorative-shape {
        width: 150px !important;
        height: 150px !important;
    }
}

/* ========================================
   MOBILE PAGE HEADERS
   ======================================== */

@media (max-width: 768px) {
    .page-header {
        padding: 4rem 0 3rem;
        min-height: auto;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }
}

/* ========================================
   MOBILE STATS SECTION
   ======================================== */

@media (max-width: 768px) {

    .stats-grid,
    .jobs-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card,
    .stat-box {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {

    .stats-grid,
    .jobs-stats {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   MOBILE TESTIMONIALS & OTHERS
   ======================================== */

@media (max-width: 768px) {
    .testimonial-card {
        padding: 1.5rem;
    }

    .testimonial-author {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .author-avatar {
        margin: 0 auto;
    }
}

/* ========================================
   MOBILE FAQ / ACCORDION
   ======================================== */

@media (max-width: 768px) {

    .faq-item,
    .accordion-item {
        padding: 1.25rem;
    }

    .faq-question,
    .accordion-header {
        font-size: 1.1rem;
        padding-right: 2rem;
    }

    .faq-answer,
    .accordion-content {
        font-size: 0.95rem;
        padding-top: 1rem;
    }
}

/* ========================================
   MOBILE JOBS PAGE
   ======================================== */

@media (max-width: 768px) {
    .job-filters {
        flex-direction: column;
        gap: 1rem;
    }

    .job-search-form {
        grid-template-columns: 1fr;
    }

    .jobs-grid {
        grid-template-columns: 1fr;
    }

    .job-card {
        padding: 1.5rem;
    }

    .job-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .job-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .job-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .job-apply-btn {
        width: 100%;
    }
}

/* ========================================
   MOBILE BLOG PAGE
   ======================================== */

@media (max-width: 768px) {
    .featured-post {
        grid-template-columns: 1fr;
    }

    .featured-image {
        height: 250px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-btn {
        width: 100%;
    }
}

/* ========================================
   MOBILE CONTACT PAGE
   ======================================== */

@media (max-width: 768px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-form-section {
        padding: 1.5rem;
    }
}

/* ========================================
   MOBILE FOOTER
   ======================================== */

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section {
        padding: 1.5rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .footer-section:last-child {
        border-bottom: none;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ========================================
   MOBILE ANIMATIONS & PERFORMANCE
   ======================================== */

@media (max-width: 768px) {
    .card:hover {
        transform: translateY(-5px) scale(1.01);
    }

    .btn:hover {
        transform: translateY(-2px);
    }

    /* Faster animations for mobile */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }

    /* Disable complex animations */
    .orb-1,
    .orb-2 {
        animation-duration: 25s;
    }

    /* Touch-friendly active states */
    .card:active,
    .btn:active {
        transform: scale(0.98);
    }

    /* Scroll Reveal */
    .scroll-reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: all 0.4s ease;
    }

    .scroll-reveal.active {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   UTILITIES
   ======================================== */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    .whatsapp-sticky {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .whatsapp-sticky i {
        font-size: 1.75rem;
    }
}

/* ========================================
   TABLET OPTIMIZATIONS
   ======================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 var(--tablet-padding);
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   EXTENDED HOME PAGE MOBILE POLISH
   ("Make it attractive & working")
   ======================================== */

@media (max-width: 768px) {

    /* 1. Logo Fix for Small Screens */
    .logo span {
        font-size: 1.1rem;
        /* Slightly smaller text */
    }

    .logo img {
        width: 35px;
        /* Smaller icon */
    }

    /* 2. Hero Section Refinement */
    .hero {
        padding-top: 6rem;
        /* Push content down a bit */
        padding-bottom: 4rem;
        background-position: center bottom;
        /* Better gradient alignment */
    }

    .hero-buttons {
        gap: 0.8rem;
    }

    .hero-buttons .btn {
        border-radius: 50px;
        /* Modern rounded buttons for mobile */
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        /* Subtle depth */
    }

    /* 3. Section Spacing & dividers */
    section {
        position: relative;
    }

    section::after {
        /* Subtle separator */
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: rgba(0, 0, 0, 0.05);
        border-radius: 3px;
    }

    /* 4. Card Polish */
    .card,
    .service-card,
    .job-card {
        border-radius: 16px;
        /* Smoother corners */
        border: 1px solid rgba(0, 0, 0, 0.03);
        /* Very subtle border */
    }

    /* 5. Stats Polish */
    .stat-number {
        font-size: 2.2rem;
        /* Perfect size */
    }

    /* 6. Mobile Menu Polish */
    .nav-menu {
        padding-top: 3rem;
    }

    .nav-menu li {
        transform: none !important;
        /* Reset any desktop transforms */
        opacity: 1 !important;
        /* Ensure visible */
    }

    /* 7. Ensure Animations Work */
    .scroll-reveal {
        transition-delay: 0s !important;
        /* Remove delay for snappier feel */
    }
}