/* Mobile Forms Specific Fixes */

/* Mobile device detection */
.mobile-device .form-control,
.mobile-device .form-select {
    font-size: 16px !important;
    min-height: 48px !important;
    padding: 0.75rem 1rem !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    color: #212529 !important;
    font-weight: 500 !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.mobile-device .form-control:focus,
.mobile-device .form-select:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    background-color: #ffffff !important;
    color: #212529 !important;
    outline: none !important;
}

/* Form labels on mobile */
.mobile-device .form-label {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #495057 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
}

/* Table inputs on mobile */
.mobile-device .table input[type="number"],
.mobile-device .table input[type="text"],
.mobile-device .table select {
    font-size: 16px !important;
    min-height: 40px !important;
    padding: 0.5rem !important;
    border: 2px solid #dee2e6 !important;
    background-color: #ffffff !important;
    color: #212529 !important;
    font-weight: 500 !important;
    width: 100% !important;
    text-align: center !important;
}

.mobile-device .table input[type="number"]:focus,
.mobile-device .table input[type="text"]:focus,
.mobile-device .table select:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    background-color: #ffffff !important;
    color: #212529 !important;
    outline: none !important;
}

/* Number inputs with step buttons */
.input-group-mobile {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group-mobile .form-control {
    padding-left: 40px !important;
    padding-right: 40px !important;
    text-align: center !important;
}

.input-group-mobile .btn {
    position: absolute;
    z-index: 10;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group-mobile .btn:first-child {
    left: 5px;
}

.input-group-mobile .btn:last-child {
    right: 5px;
}

/* Card improvements for mobile */
.mobile-device .card {
    border: 1px solid #dee2e6 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    margin-bottom: 1rem !important;
}

.mobile-device .card-header {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 1rem !important;
}

.mobile-device .card-body {
    padding: 1rem !important;
}

.mobile-device .card-footer {
    background-color: #f8f9fa !important;
    border-top: 1px solid #dee2e6 !important;
    padding: 1rem !important;
}

/* Button improvements for mobile */
.mobile-device .btn {
    font-size: 14px !important;
    padding: 0.75rem 1.5rem !important;
    min-height: 44px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    border: 2px solid transparent !important;
    transition: all 0.2s ease !important;
}

.mobile-device .btn:active {
    transform: scale(0.95) !important;
}

.mobile-device .btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.mobile-device .btn-primary:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
}

.mobile-device .btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

.mobile-device .btn-secondary:hover {
    background-color: #5c636a !important;
    border-color: #565e64 !important;
}

/* Table improvements for mobile */
.mobile-device .table-responsive {
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.mobile-device .table {
    font-size: 14px !important;
    margin-bottom: 0 !important;
}

.mobile-device .table th,
.mobile-device .table td {
    padding: 0.75rem 0.5rem !important;
    vertical-align: middle !important;
    border-color: #dee2e6 !important;
    font-size: 14px !important;
    color: #212529 !important;
    white-space: nowrap !important;
}

.mobile-device .table th {
    background-color: #f8f9fa !important;
    font-weight: 600 !important;
    color: #495057 !important;
    border-bottom: 2px solid #dee2e6 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
}

/* Alert improvements for mobile */
.mobile-device .alert {
    font-size: 14px !important;
    padding: 1rem !important;
    border-radius: 8px !important;
    margin-bottom: 1rem !important;
    border: 1px solid transparent !important;
}

.mobile-device .alert-success {
    background-color: #d1e7dd !important;
    border-color: #badbcc !important;
    color: #0f5132 !important;
}

.mobile-device .alert-danger {
    background-color: #f8d7da !important;
    border-color: #f5c2c7 !important;
    color: #842029 !important;
}

.mobile-device .alert-warning {
    background-color: #fff3cd !important;
    border-color: #ffecb5 !important;
    color: #664d03 !important;
}

.mobile-device .alert-info {
    background-color: #d1ecf1 !important;
    border-color: #b6effb !important;
    color: #055160 !important;
}

/* Container and spacing improvements */
.mobile-device .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.mobile-device .row {
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
}

.mobile-device .row > * {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

/* Navigation improvements for mobile */
.mobile-device .navbar-nav .nav-link {
    font-size: 14px !important;
    padding: 0.75rem 1rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.mobile-device .navbar-nav .nav-link:hover {
    color: #ffffff !important;
}

/* Dropdown improvements for mobile */
.mobile-device .dropdown-menu {
    font-size: 14px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    min-width: 200px !important;
}

.mobile-device .dropdown-item {
    font-size: 14px !important;
    padding: 0.75rem 1rem !important;
    color: #495057 !important;
}

.mobile-device .dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

/* Focus improvements for accessibility */
.mobile-device .form-control:focus,
.mobile-device .form-select:focus,
.mobile-device .btn:focus {
    outline: 2px solid #0d6efd !important;
    outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mobile-device .form-control,
    .mobile-device .form-select {
        border-color: #000000 !important;
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    
    .mobile-device .form-control:focus,
    .mobile-device .form-select:focus {
        border-color: #0000ff !important;
        box-shadow: 0 0 0 2px #0000ff !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .mobile-device .btn,
    .mobile-device .form-control,
    .mobile-device .form-select {
        transition: none !important;
    }
    
    .mobile-device .btn:active {
        transform: none !important;
    }
}

/* Print styles for mobile */
@media print {
    .mobile-device .form-control,
    .mobile-device .form-select {
        background-color: transparent !important;
        border: 1px solid #000 !important;
        color: #000 !important;
        font-size: 12px !important;
    }
    
    .mobile-device .table input[type="number"],
    .mobile-device .table input[type="text"],
    .mobile-device .table select {
        background-color: transparent !important;
        border: 1px solid #000 !important;
        color: #000 !important;
    }
}

