/**
 * Mobile Optimization CSS
 * Ensures 100% mobile compatibility
 */

/* Base Mobile Styles */
@media (max-width: 768px) {
    /* Container adjustments */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Typography adjustments */
    .display-1 { font-size: 3rem !important; }
    .display-2 { font-size: 2.5rem !important; }
    .display-3 { font-size: 2rem !important; }
    .display-4 { font-size: 1.75rem !important; }
    .display-5 { font-size: 1.5rem !important; }
    
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    
    /* Button optimizations */
    .btn {
        min-height: 44px; /* Touch-friendly minimum */
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .btn-lg {
        min-height: 48px;
        font-size: 1.1rem;
    }
    
    /* Form optimizations */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    /* Navigation optimizations */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.5rem;
        font-size: 1.5rem;
    }
    
    /* Card optimizations */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Table responsiveness */
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table td, .table th {
        padding: 0.5rem;
        white-space: nowrap;
    }
    
    /* Modal optimizations */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Spacing adjustments */
    .my-5 { margin: 2rem 0 !important; }
    .py-5 { padding: 2rem 0 !important; }
    
    /* Image optimizations */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Text optimizations */
    .text-center-mobile {
        text-align: center !important;
    }
    
    .d-none-mobile {
        display: none !important;
    }
    
    .d-block-mobile {
        display: block !important;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    /* Even smaller adjustments */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .display-1 { font-size: 2.5rem !important; }
    .display-4 { font-size: 1.5rem !important; }
    
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.25rem !important; }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Stack columns on very small screens */
    .row > div {
        margin-bottom: 1rem;
    }
    
    /* Accordion optimizations */
    .accordion-button {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .accordion-body {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* Landscape phone optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar-collapse {
        max-height: 300px;
        overflow-y: auto;
    }
    
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Touch optimizations */
@media (pointer: coarse) {
    /* Larger touch targets */
    a, button, .btn, .nav-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Hover effects disabled on touch devices */
    .btn:hover, .nav-link:hover {
        transform: none;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisp images on retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bg-light {
        background-color: #343a40 !important;
        color: #fff;
    }
    
    .text-dark {
        color: #fff !important;
    }
    
    .border {
        border-color: #495057 !important;
    }
}

/* Print styles */
@media print {
    .navbar, .modal, .btn, .social-links, .d-print-none {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
    
    a {
        text-decoration: none !important;
        color: #000 !important;
    }
    
    .text-primary, .text-success, .text-info, .text-warning, .text-danger {
        color: #000 !important;
    }
}

/* Performance optimizations */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea, [contenteditable] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

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