/* Mobile-First Optimizations for Better Performance and UX */

/* Touch-friendly interactions */
@media (max-width: 991px) {
    /* Increase touch targets */
    .btn, button, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
    }
    
    /* Improve form usability */
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }
    
    /* Better spacing for mobile */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Optimize images for mobile */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    /* Improve readability */
    p, li {
        line-height: 1.6;
        font-size: 15px;
    }
    
    /* Better navigation for mobile */
    .navbar-nav .nav-link {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    /* Optimize modals for mobile */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    /* Better card layouts */
    .card {
        margin-bottom: 20px;
        border-radius: 8px;
    }
    
    /* Optimize tables for mobile */
    .table-responsive {
        border: none;
    }
    
    /* Better form layouts */
    .form-group {
        margin-bottom: 20px;
    }
    
    /* Optimize search forms */
    .search-form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .search-form .form-control {
        margin-bottom: 10px;
    }
    
    .search-form .btn {
        width: 100%;
    }
}

/* Extra small devices optimization */
@media (max-width: 480px) {
    /* Reduce padding for very small screens */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Smaller font sizes for very small screens */
    h1 { font-size: 24px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 18px !important; }
    h4 { font-size: 16px !important; }
    h5 { font-size: 14px !important; }
    h6 { font-size: 13px !important; }
    
    /* Optimize buttons for small screens */
    .btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    /* Better modal sizing */
    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }
    
    /* Optimize cards */
    .card {
        margin-bottom: 15px;
        padding: 10px;
    }
}

/* Performance optimizations */
* {
    -webkit-tap-highlight-color: transparent;
}

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

/* Optimize animations for mobile */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Better focus states for accessibility */
button:focus, 
input:focus, 
textarea:focus, 
select:focus,
.btn:focus {
    outline: 2px solid var(--theme-color);
    outline-offset: 2px;
}

/* Optimize loading states */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Better error states */
.error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

/* Optimize success states */
.success {
    color: #28a745;
    font-size: 14px;
    margin-top: 5px;
}