/* Mobile Optimization CSS for Clinic Booking System */

/* Base mobile styles */
@media (max-width: 768px) {
    body {
        font-size: 0.9rem;
    }

    .container,
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Touch targets - minimum 44px */
    .btn,
    .nav-link,
    .form-control,
    .time-slot,
    button {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }

    /* Form improvements */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
    }

    .form-label {
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    /* Modal improvements */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .modal-content {
        border-radius: 8px;
    }

    .modal-header,
    .modal-footer {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    /* Table improvements */
    .table-responsive {
        border: none;
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
        white-space: nowrap;
    }

    /* Card improvements */
    .card {
        border-radius: 8px;
        margin-bottom: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Navigation improvements */
    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Alert improvements */
    .alert {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.85rem;
    }

    .container,
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Smaller touch targets for very small screens */
    .btn,
    .nav-link,
    .form-control,
    .time-slot {
        min-height: 42px;
    }

    .form-control {
        padding: 0.5rem;
    }

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

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    h5 {
        font-size: 1rem;
    }

    /* Hide less critical information */
    .d-none-mobile {
        display: none !important;
    }

    /* Stack elements vertically */
    .stack-mobile {
        flex-direction: column !important;
    }

    .stack-mobile > * {
        margin-bottom: 0.5rem;
    }

    /* Button adjustments */
    .btn-group-vertical .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        margin-bottom: 0.25rem;
    }

    /* Table column hiding for very small screens */
    .table .d-none-xs {
        display: none !important;
    }
}

/* Touch and interaction improvements */
.btn:active,
.nav-link:active,
.time-slot:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.1rem;
}

/* Haptic feedback simulation */
@keyframes vibrate {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}

.vibrate {
    animation: vibrate 0.1s ease-in-out;
}

/* Improved focus states for accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Loading overlay for mobile */
.mobile-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Mobile-specific utilities */
.text-center-mobile {
    text-align: center !important;
}

.mb-mobile {
    margin-bottom: 1rem !important;
}

.p-mobile {
    padding: 1rem !important;
}

.px-mobile {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.py-mobile {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }

    .sidebar {
        min-height: auto;
    }

    .form-container {
        padding: 1rem;
    }
}

/* Dark mode support for mobile */
@media (prefers-color-scheme: dark) {
    .btn-outline-primary {
        border-color: #667eea;
        color: #667eea;
    }

    .btn-outline-primary:hover {
        background-color: #667eea;
        border-color: #667eea;
        color: white;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .nav-link,
    .time-slot,
    .card,
    .modal {
        transition: none !important;
        animation: none !important;
    }
}