/* ============================================
   UNIVERSAL MOBILE RESPONSIVE STYLES
   Applied globally to ensure all pages are mobile-friendly
   ============================================ */

/* Base Mobile Adjustments */
@media (max-width: 1024px) {
    body {
        font-size: 15px;
    }

    /* Typography adjustments */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    /* Button adjustments */
    .button,
    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    /* Form adjustments */
    input,
    select,
    textarea {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    /* Typography adjustments */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    /* Button adjustments */
    .button,
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Form adjustments */
    input,
    select,
    textarea {
        font-size: 14px;
        padding: 10px 14px;
    }

    /* Modal adjustments */
    .modal,
    .popup {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    /* Table adjustments */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Grid adjustments */
    .row {
        margin: 0 -12px;
    }

    .col {
        padding: 0 12px;
    }
}

@media (max-width: 600px) {

    /* Hide less important elements on small screens */
    .desktop-only {
        display: none !important;
    }

    /* Stack columns on mobile */
    .col {
        flex: 1 0 100%;
        margin-bottom: 16px;
    }

    /* Full-width buttons on small screens */
    .button-full-mobile,
    .btn-full-mobile {
        width: 100%;
        display: block;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    /* Typography adjustments */
    h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.35rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.15rem;
    }

    h4 {
        font-size: 1rem;
    }

    /* Button adjustments */
    .button,
    .btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    /* Form adjustments */
    input,
    select,
    textarea {
        font-size: 13px;
        padding: 8px 12px;
    }

    /* Modal adjustments */
    .modal,
    .popup {
        margin: 6px;
        max-width: calc(100% - 12px);
        border-radius: 8px;
    }

    /* Spacing adjustments */
    .row {
        margin: 0 -8px;
    }

    .col {
        padding: 0 8px;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    button,
    input[type="button"]
    .clickable {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    a,
    input[type="submit"],
    .clickable {
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    *:hover {
        transition: none;
    }

}

/* Landscape phone orientation */
@media (max-width: 896px) and (orientation: landscape) {
    body {
        font-size: 14px;
    }

    /* Reduce vertical padding in landscape */
    section,
    .section {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    /* Adjust header height for landscape */
    .header {
        height: auto;
        min-height: 52px;
    }
}

/* Very small devices (Galaxy Fold, etc) */
@media (max-width: 320px) {
    body {
        font-size: 12px;
    }

    .container {
        padding: 0 6px;
    }

    h1 {
        font-size: 1.35rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1.05rem;
    }

    .button,
    .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    input,
    select,
    textarea {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Utility Classes for Mobile */
.mobile-hidden {
    display: none;
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }

    .mobile-hidden {
        display: block;
    }
}

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

    .desktop-only {
        display: none !important;
    }
}

/* Mobile-specific scrolling improvements */
@media (max-width: 768px) {
    /* Smooth scrolling on mobile */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Better text rendering on mobile */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }

    /* Prevent zoom on input focus (iOS) */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Improve tap highlighting */
    a,
    button,
    input,
    textarea,
    select {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }

    /* Disable text selection on UI elements */
    .button,
    .btn,
    button {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS input zoom */
    input,
    select,
    textarea {
        font-size: 16px;
    }

    /* Fix for iOS viewport height with address bar */
    body {
        min-height: -webkit-fill-available;
    }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}
