/* ========================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ======================================== */

/* Fix: Hide hamburger on desktop by default */
.hamburger {
    display: none;
}

/* Global Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    line-height: 1;
}

/* Enhanced Mobile Navigation */
@media (max-width: 768px) {

    /* Header adjustments */
    header {
        padding: 0.75rem 0;
    }

    .logo {
        font-size: 1.25rem;
    }

    .hamburger {
        display: block !important;
        color: #333 !important;
        z-index: 1001;
        font-size: 2rem;
        background: none;
        border: none;
        cursor: pointer;
    }

    .nav-links {
        position: fixed;
        top: 85px;
        /* Matches logo height + padding */
        left: 0;
        width: 100%;
        max-height: calc(100vh - 85px);
        overflow-y: auto;
        background-color: var(--primary-color);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 999;
        display: flex;
        flex-direction: column;
        transform: translateY(-150%);
        transition: transform 0.4s ease-in-out;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .nav-links a {
        color: white !important;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
        width: 100%;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: var(--accent-color) !important;
        background-color: rgba(255, 255, 255, 0.05);
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        max-height: none;
        background: var(--primary-dark);
    }

    .dropdown-menu a {
        padding: 0.75rem 1.5rem 0.75rem 2.5rem;
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.9) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-align: left;
    }

    .dropdown-menu a:hover {
        color: var(--accent-color) !important;
        background-color: rgba(255, 255, 255, 0.05);
        padding-left: 2.75rem;
    }
}

/* Hero Section Mobile Optimization */
@media (max-width: 768px) {
    .hero {
        height: 70vh;
        min-height: 500px;
    }

    .hero-content {
        padding: var(--spacing-sm);
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero h3 {
        font-size: 1.1rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .hero .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
        margin: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        height: 60vh;
        min-height: 450px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero h3 {
        font-size: 1rem;
    }
}

/* Service Cards Mobile */
@media (max-width: 768px) {
    .service-card {
        height: 280px;
    }

    .service-icon {
        font-size: 2.5rem;
    }

    .service-card h3 {
        font-size: 1.25rem;
    }

    .service-card p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .service-card {
        height: 260px;
    }

    .service-icon {
        font-size: 2rem;
    }
}

/* Stats Section Mobile */
@media (max-width: 768px) {
    .stats-section {
        background-attachment: scroll;
    }

    .stat-item {
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .stat-item h4 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 2rem;
    }
}

/* Projects Grid Mobile */
@media (max-width: 768px) {
    .project-card {
        aspect-ratio: 16/10;
    }

    .project-overlay h3 {
        font-size: 1.1rem;
    }

    .project-overlay p {
        font-size: 0.85rem;
    }
}

/* Core Values Mobile */
@media (max-width: 768px) {
    .core-values-header h2 {
        font-size: 2rem;
    }

    .core-values-icon {
        font-size: 2rem;
    }

    .cv-circle-wrapper {
        width: 200px;
        height: 200px;
    }

    .cv-item h4 {
        font-size: 1.1rem;
    }

    .cv-item p {
        font-size: 0.85rem;
    }
}

/* Footer Mobile */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    footer h3,
    footer h4 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    footer p,
    footer li {
        font-size: 0.9rem;
    }
}

/* Page Header Mobile */
@media (max-width: 768px) {
    .page-header-simple {
        padding: 6rem 0 3rem;
    }

    .page-header-simple h1 {
        font-size: 2rem;
    }

    .page-header-simple p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .page-header-simple {
        padding: 5rem 0 2.5rem;
    }

    .page-header-simple h1 {
        font-size: 1.75rem;
    }
}

/* Section Padding Mobile */
@media (max-width: 768px) {
    .section {
        padding: var(--spacing-md) 0;
    }

    .container {
        padding: 0 1rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.35rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 1.5rem 0;
    }

    .container {
        padding: 0 0.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Button Mobile */
@media (max-width: 768px) {
    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        display: inline-block;
        width: auto;
    }

    .btn-secondary {
        margin-top: 0.5rem;
    }
}

/* Grid System Mobile */
@media (max-width: 768px) {
    .grid {
        gap: 1.5rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .grid {
        gap: 1rem;
    }
}

/* Certificates Slider Mobile */
@media (max-width: 768px) {
    .certificate-item {
        flex: 0 0 250px;
    }
}

@media (max-width: 480px) {
    .certificate-item {
        flex: 0 0 200px;
    }
}

/* Lightbox Mobile */
@media (max-width: 768px) {
    .lightbox {
        padding: var(--spacing-sm);
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 85vh;
    }

    .lightbox-close {
        top: -30px;
        font-size: 1.75rem;
    }
}

/* Typography Mobile Adjustments */
@media (max-width: 768px) {
    body {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    p {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 0.9rem;
    }
}

/* Touch-Friendly Improvements */
@media (max-width: 768px) {

    /* Increase tap target sizes */
    a,
    button,
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Better spacing for touch */
    .nav-links li {
        margin-bottom: 0;
    }

    .nav-links a {
        display: block;
        padding: 1rem 1.5rem;
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        height: 100vh;
    }

    .hero-content {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero h3 {
        font-size: 1rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 375px) {
    .container {
        padding: 0 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1.15rem;
    }

    .btn {
        padding: 0.5rem 0.85rem;
        font-size: 0.8rem;
    }
}

/* Tablet Optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 960px;
        padding: 0 1.5rem;
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .service-card {
        height: 300px;
    }
}

/* Prevent horizontal scroll */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    * {
        max-width: 100%;
    }

    img {
        height: auto;
    }
}

/* Form Elements Mobile */
@media (max-width: 768px) {

    input,
    textarea,
    select {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 0.75rem;
    }
}

/* Areas of Operation Mobile */
@media (max-width: 768px) {
    .area-card-image {
        height: 180px;
    }

    .area-card-title h3 {
        font-size: 1.1rem;
    }

    .area-card-title p {
        font-size: 0.85rem;
    }
}

/* Client Slider Mobile Optimization */
@media (max-width: 768px) {
    .client-slide {
        width: 150px;
        height: 80px;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .client-slide {
        width: 120px;
        height: 70px;
        padding: 0.5rem;
    }
}

/* Improved Scrollbar for Mobile */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 6px;
    }

    ::-webkit-scrollbar-track {
        background: var(--bg-light);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 3px;
    }
}

/* Animation Performance on Mobile */
@media (max-width: 768px) {

    .fade-up,
    .fade-in-left,
    .fade-in-right,
    .zoom-in {
        transition-duration: 0.4s;
    }

    /* Reduce animation complexity on mobile */
    .service-card:hover .service-card-inner {
        transform: none;
    }

    .service-card-back {
        display: none;
    }

    .service-card-front {
        position: static;
    }
}

/* Contact Page Mobile (if exists) */
@media (max-width: 768px) {
    .contact-form {
        padding: 1.5rem;
    }

    .contact-info {
        margin-bottom: 2rem;
    }
}

/* Projects Page Mobile */
@media (max-width: 768px) {
    .project-filters {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .project-filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* About Page Mobile */
@media (max-width: 768px) {
    .company-overview {
        text-align: center;
    }

    .who-we-are-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-right: 0 !important;
    }

    .who-we-are-content h2 {
        display: inline-block;
        margin-bottom: 2rem;
    }

    .company-overview img {
        margin: 0 auto;
    }

    .who-we-are-content h2::after {
        left: 50% !important;
        transform: translateX(-50%);
    }

    .timeline-item {
        padding-left: 2rem;
    }

    .timeline-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* Services Page Mobile */
@media (max-width: 768px) {
    .service-detail-card {
        padding: 1.5rem;
    }

    .service-detail-image {
        height: 200px;
    }
}

/* Utility Classes for Mobile */
@media (max-width: 768px) {
    .mobile-hide {
        display: none !important;
    }

    .mobile-show {
        display: block !important;
    }

    .mobile-text-center {
        text-align: center !important;
    }

    .mobile-full-width {
        width: 100% !important;
    }
}

/* Print Styles */
@media print {

    header,
    footer,
    .hamburger,
    .btn,
    .lightbox {
        display: none;
    }

    body {
        font-size: 12pt;
        color: black;
        background: white;
    }

    a {
        text-decoration: underline;
    }
}