/* Phone-specific optimizations */

/* Viewport optimizations */
@viewport {
    width: device-width;
    initial-scale: 1.0;
}

/* Prevent zoom on input focus for iOS */
@media screen and (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Touch-friendly spacing */
@media (max-width: 480px) {
    /* Ultra-compact layout for small phones */
    .container-fluid {
        padding: 0 8px;
    }
    
    /* Grid optimizations */
    .row {
        margin: 0 -4px;
    }
    
    .row > * {
        padding: 0 4px;
    }
    
    /* Card optimizations */
    .card {
        margin-bottom: 0.5rem;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    /* Button optimizations */
    .btn {
        min-height: 36px;
        padding: 5px 8px;
        font-size: 12px;
        border-radius: 4px;
        margin: 1px;
    }
    
    .btn-group .btn {
        margin: 0;
    }
    
    /* Text optimizations */
    h1 { font-size: 1.4rem; line-height: 1.2; }
    h2 { font-size: 1.2rem; line-height: 1.2; }
    h3 { font-size: 1.1rem; line-height: 1.2; }
    h4 { font-size: 1rem; line-height: 1.2; }
    h5 { font-size: 0.9rem; line-height: 1.2; }
    h6 { font-size: 0.8rem; line-height: 1.2; }
    
    p, .text, .lead {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .small, small {
        font-size: 11px;
    }
    
    /* Table text */
    .table td, .table th {
        font-size: 12px;
        line-height: 1.3;
    }
    
    /* Image optimizations */
    img {
        max-width: 100%;
        height: auto;
    }
    
    .card img {
        max-height: 60px;
        object-fit: cover;
        border-radius: 4px;
    }
    
    /* Navigation optimizations */
    .navbar {
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-brand {
        font-size: 0.9rem !important;
        padding: 0.25rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 12px;
    }
    
    .navbar-toggler {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
    
    /* Badge optimizations */
    .badge {
        font-size: 0.6rem;
        padding: 0.1em 0.3em;
    }
    
    /* Alert optimizations */
    .alert {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        font-size: 13px;
    }
    
    /* Modal optimizations */
    .modal-dialog {
        margin: 0.25rem;
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .modal-footer {
        padding: 0.5rem 0.75rem;
    }
    
    /* Table optimizations */
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 12px;
        margin-bottom: 0.5rem;
    }
    
    .table td, .table th {
        padding: 0.4rem;
        vertical-align: middle;
    }
    
    /* Form optimizations */
    .form-control {
        padding: 0.4rem;
        font-size: 14px;
        border-radius: 4px;
        height: auto;
        min-height: 36px;
    }
    
    /* Search box specific */
    input[type="search"], .form-control[type="search"] {
        padding: 0.3rem 0.5rem;
        font-size: 13px;
        height: 32px;
    }
    
    /* Checkbox optimizations */
    input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin: 0 0.25rem;
    }
    
    .form-check-input {
        width: 16px;
        height: 16px;
    }
    
    .form-label {
        font-size: 13px;
        font-weight: 500;
        margin-bottom: 0.25rem;
    }
    
    .input-group {
        margin-bottom: 0.5rem;
    }
    
    /* Footer optimizations */
    .footer {
        padding: 1rem 0;
        margin-top: 1rem !important;
    }
    
    .footer h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .footer h5 {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .footer p {
        font-size: 12px;
        margin-bottom: 0.25rem;
    }
    
    /* List optimizations */
    .list-group-item {
        padding: 0.5rem;
        font-size: 13px;
    }
    
    /* Dropdown optimizations */
    .dropdown-menu {
        font-size: 13px;
    }
    
    .dropdown-item {
        padding: 0.4rem 0.75rem;
    }
    
    /* Breadcrumb optimizations */
    .breadcrumb {
        padding: 0.4rem 0.75rem;
        font-size: 12px;
        margin-bottom: 0.5rem;
    }
    
    /* Pagination optimizations */
    .pagination {
        margin-bottom: 0.5rem;
    }
    
    .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 12px;
    }
    
    /* Progress bar optimizations */
    .progress {
        height: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    /* Tooltip optimizations for touch */
    .tooltip {
        display: none !important;
    }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
    /* Larger touch targets for accessibility */
    button, a, input, select, textarea {
        min-height: 44px;
    }
    
    /* Focus indicators */
    button:focus, a:focus, input:focus, select:focus, textarea:focus {
        outline: 2px solid #0d6efd;
        outline-offset: 2px;
    }
    
    /* High contrast for better visibility */
    .text-muted {
        color: #6c757d !important;
    }
    
    /* Better spacing for readability */
    p, .text {
        line-height: 1.5;
    }
}