/* Mobile-specific styles for better touch interactions and spacing */

/* Touch-friendly buttons and inputs */
@media (max-width: 768px) {
    /* Ensure buttons are large enough for touch */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Form inputs full width on mobile */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        min-height: 44px;
    }
    
    /* Better spacing for form groups */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Card padding adjustments */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Table responsive improvements */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    
    /* DataTables mobile improvements */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 1rem;
    }
    
    .dataTables_wrapper .dataTables_length select,
    .dataTables_wrapper .dataTables_filter input {
        min-height: 44px;
        font-size: 16px;
    }
    
    /* Action buttons in tables */
    .table .btn-sm {
        min-height: 36px;
        padding: 0.5rem;
        margin: 0.25rem;
    }
    
    /* Better spacing for lists */
    .list-group-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
    }
    
    /* Time picker mobile styles */
    .ui-timepicker-wrapper {
        max-width: 100%;
        z-index: 9999 !important;
    }
    
    /* Calendar mobile adjustments */
    .fc-toolbar {
        flex-wrap: wrap;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    /* Spinner adjustments */
    .spinner-border {
        width: 2rem;
        height: 2rem;
    }
    
    /* Better text sizing */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    /* Sidebar mobile adjustments */
    .layout-menu {
        width: 100%;
    }
    
    /* Navbar mobile */
    .navbar-nav {
        flex-direction: column;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header h5 {
        margin-bottom: 0.5rem;
    }
    
    /* Stack buttons vertically on very small screens */
    .btn-group-vertical .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Time picker specific mobile fixes */
@media (max-width: 768px) {
    .ui-timepicker-list {
        max-height: 200px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ui-timepicker-list li {
        padding: 0.75rem;
        font-size: 1rem;
        min-height: 44px;
    }
}

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

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
}

/* Inline spinner */
.inline-spinner {
    display: inline-block;
    margin: 0 0.5rem;
}

/* Touch target improvements */
@media (max-width: 768px) {
    a, button, input[type="checkbox"], input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Links in tables */
    .table a {
        display: inline-block;
        padding: 0.5rem;
    }
}

/* Modern Filter Section Styles */
.teacher-filter-list {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.teacher-checkbox-wrapper {
    border-radius: 0.375rem;
    cursor: pointer;
}

.teacher-checkbox-wrapper:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.teacher-checkbox-wrapper input[type="checkbox"] {
    cursor: pointer;
    width: 1.25rem;
    height: 1.25rem;
}

.teacher-checkbox-wrapper label {
    user-select: none;
    margin-bottom: 0;
}

.teacher-name {
    flex: 1;
    padding-right: 0.5rem;
}

.teacher-spinner {
    flex-shrink: 0;
}

#teacherSearch {
    border-left: none;
}

#teacherSearch:focus {
    border-color: #0b8cde;
    box-shadow: 0 0 0 0.2rem rgba(11, 140, 222, 0.25);
}

.input-group-text {
    border-right: none;
}

@media (max-width: 768px) {
    .teacher-filter-list {
        max-height: 250px !important;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    #checkAllBtn, #clearAllBtn {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
    
    /* Mobile filter improvements */
    .mobile-filter-card .card-body {
        padding: 0.75rem !important;
    }
    
    .teacher-item {
        margin-bottom: 0.5rem !important;
    }
    
    .input-group-text {
        padding: 0.75rem;
    }
}
