/* ====================================
   MOBILE-SPECIFIC ENHANCEMENTS
   For optimal mobile user experience
   ==================================== */

/* Touch-Friendly Button Sizes */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        /* iOS recommended tap target size */
        min-width: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .btn-sm {
        min-height: 38px;
        padding: 0.5rem 1rem;
    }

    .btn-lg {
        min-height: 50px;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}

/* Mobile Navigation Improvements */
@media (max-width: 991px) {
    .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        border: 2px solid var(--primary-color);
        padding: 0.5rem;
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.25rem rgba(0, 255, 136, 0.25);
    }

    .navbar-collapse {
        margin-top: 1rem;
        background: rgba(10, 10, 18, 0.98);
        border-radius: 8px;
        padding: 1rem;
    }

    .nav-link {
        padding: 1rem !important;
        /* Larger touch targets */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link:last-child {
        border-bottom: none;
    }
}

/* Improve Form Inputs for Mobile */
@media (max-width: 768px) {

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 0.75rem 1rem;
    }

    textarea {
        min-height: 100px;
    }
}

/* Card Touch Improvements */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1.5rem;
    }

    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Mobile-Optimized Tables */
@media (max-width: 768px) {
    .table-responsive {
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }

    table {
        font-size: 0.85rem;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
    }
}

/* Better Mobile Modals */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* Mobile Hero Section */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        padding-top: 80px;
    }

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

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

@media (max-width: 576px) {
    .hero-section {
        min-height: 50vh;
        padding-top: 70px;
    }

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

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

/* Mobile-Friendly Spacing */
@media (max-width: 768px) {
    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 576px) {
    .section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .section-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }
}

/* Mobile Grid Improvements */
@media (max-width: 768px) {
    .row>* {
        margin-bottom: 1rem;
    }

    .row>*:last-child {
        margin-bottom: 0;
    }
}

/* Sticky Mobile Elements */
@media (max-width: 768px) {
    .navbar.scrolled {
        position: sticky;
        top: 0;
        z-index: 1030;
    }
}

/* Prevent Text Selection on Interactive Elements (Mobile) */
@media (max-width: 768px) {

    .btn,
    .card,
    .nav-link,
    button {
        -webkit-tap-highlight-color: rgba(0, 255, 136, 0.2);
        -webkit-touch-callout: none;
        user-select: none;
    }
}

/* Mobile-Optimized Animations */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Better Touch Scrolling */
@media (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: touch;
    }

    .modal-body,
    .overflow-auto {
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile Footer */
@media (max-width: 768px) {
    .footer {
        padding: 2rem 0 1rem;
    }

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

    .footer-section h5 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .footer-link {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }

    .social-links {
        margin-top: 1rem;
    }

    .social-links a {
        width: 44px;
        height: 44px;
        line-height: 44px;
        font-size: 1.2rem;
        margin-right: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

/* Mobile Language & Theme Switchers */
@media (max-width: 768px) {

    #themeToggle,
    .lang-switcher a {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem;
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding-top: 60px;
    }

    .navbar {
        padding: 0.25rem 0;
    }
}

/* Safe Area for Notched Devices (iPhone X+) */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .navbar,
    .footer {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Image Loading Optimization for Mobile */
@media (max-width: 768px) {
    img {
        height: auto;
        max-width: 100%;
    }

    img[loading="lazy"] {
        opacity: 0;
        transition: opacity 0.3s;
    }

    img[loading="lazy"].loaded {
        opacity: 1;
    }
}

/* Mobile Video Players */
@media (max-width: 768px) {
    video {
        width: 100%;
        height: auto;
    }

    .video-thumbnail {
        height: 180px;
    }
}

/* Mobile Contact Section */
@media (max-width: 768px) {

    .contact-card,
    .map-card {
        margin-bottom: 1rem;
    }
}

/* Improved Mobile Typography */
@media (max-width: 576px) {
    body {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    h5 {
        font-size: 1rem;
    }

    h6 {
        font-size: 0.95rem;
    }
}

/* PWA Viewport Fix */
@media (max-width: 768px) {
    html {
        height: -webkit-fill-available;
    }

    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}