/* Educational Enterprise Mobile Professional */
/* Responsive breakpoints and touch-friendly interfaces */

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Mobile First Approach - Default styles for mobile */
@media (max-width: 767.98px) {
    
    /* Navigation optimizations */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    /* Touch-friendly button sizing */
    .btn {
        min-height: 44px; /* iOS touch target minimum */
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    /* Card spacing for mobile */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Form elements touch optimization */
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    /* Modal optimizations for mobile */
    .modal-dialog {
        margin: 10px;
        width: calc(100vw - 20px);
        max-width: none;
    }
    
    .modal-content {
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 1.25rem 1rem;
        border-radius: 16px 16px 0 0;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Table responsive improvements */
    .table-responsive {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .table th, .table td {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    /* Navigation drawer improvements */
    .offcanvas {
        border-radius: 0 16px 16px 0;
    }
    
    .offcanvas-header {
        padding: 1.5rem 1rem 1rem 1rem;
        background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
        color: white;
        border-radius: 0 16px 0 0;
    }
    
    .offcanvas-title {
        color: white;
        font-weight: 600;
    }
    
    .offcanvas-body {
        padding: 1rem;
    }
    
    /* Mobile navigation links */
    .mobile-nav-link {
        padding: 1rem;
        margin-bottom: 0.5rem;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 500;
        color: #1e3a8a;
        text-decoration: none;
        display: flex;
        align-items: center;
        transition: all 0.2s ease-in-out;
    }
    
    .mobile-nav-link:hover {
        background-color: rgba(30, 58, 138, 0.1);
        color: #1e3a8a;
        transform: translateX(4px);
    }
    
    .mobile-nav-link.active {
        background-color: #1e3a8a;
        color: white;
    }
    
    .mobile-nav-link i {
        font-size: 1.1rem;
        width: 24px;
    }
    
    /* Content spacing for mobile */
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Header adaptations */
    .school-setup-header,
    .basisrooster-header,
    .lesplanning-header,
    .dashboard-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .school-setup-header h1,
    .basisrooster-header h1,
    .lesplanning-header h1,
    .dashboard-header h1 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .school-setup-header p,
    .basisrooster-header p,
    .lesplanning-header p,
    .dashboard-header p {
        font-size: 1rem;
    }
    
    /* Action buttons in headers */
    .header-add-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        margin-top: 1rem;
        width: 100%;
        justify-content: center;
    }
    
    /* Alert adaptations */
    .alert {
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    /* Badge sizing */
    .badge {
        font-size: 0.8rem;
        padding: 0.35em 0.6em;
    }
    
    /* List group touch optimization */
    .list-group-item {
        padding: 1rem;
        border-radius: 8px !important;
        margin-bottom: 0.25rem;
    }
    
    .list-group-item:last-child {
        margin-bottom: 0;
    }
}

/* ========================================
   TABLET OPTIMIZATIONS (768px - 991.98px)
   ======================================== */

@media (min-width: 768px) and (max-width: 991.98px) {
    
    /* Tablet-specific navigation */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin: 0 0.25rem;
        border-radius: 6px;
    }
    
    /* Grid adaptations for tablet */
    .col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* Card grid for tablet */
    .card-columns {
        column-count: 2;
        column-gap: 1rem;
    }
    
    /* Modal sizing for tablet */
    .modal-dialog {
        max-width: 600px;
        margin: 2rem auto;
    }
    
    /* Table improvements for tablet */
    .table th, .table td {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    /* Button groups for tablet */
    .btn-group .btn {
        padding: 8px 16px;
    }
}

/* ========================================
   TOUCH-FRIENDLY INTERFACES
   ======================================== */

/* Touch target improvements */
.btn, .nav-link, .list-group-item, .dropdown-item, 
.form-control, .form-select, .form-check-input {
    -webkit-tap-highlight-color: rgba(30, 58, 138, 0.1);
}

/* Prevent text selection on touch elements */
.btn, .nav-link, .mobile-nav-link, .card-header {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Drag and drop touch improvements */
.draggable {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: none;
}

/* Scrollable areas touch optimization */
.table-responsive, .offcanvas-body, .modal-body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ========================================
   PROFESSIONAL MOBILE NAVIGATION
   ======================================== */

/* Mobile hamburger menu enhancement */
.navbar-toggler {
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Improved mobile dropdown */
.dropdown-menu {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 2px;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: rgba(30, 58, 138, 0.1);
    color: #1e3a8a;
}

/* ========================================
   MOBILE-SPECIFIC COMPONENTS
   ======================================== */

/* Mobile action sheet style modals */
@media (max-width: 767.98px) {
    .modal.mobile-sheet .modal-dialog {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        width: 100%;
        max-width: none;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .modal.mobile-sheet.show .modal-dialog {
        transform: translateY(0);
    }
    
    .modal.mobile-sheet .modal-content {
        border-radius: 16px 16px 0 0;
        border: none;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    }
}

/* Mobile floating action button */
.mobile-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1000;
    transition: all 0.2s ease-in-out;
}

.mobile-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

@media (min-width: 768px) {
    .mobile-fab {
        display: none;
    }
}

/* Mobile search bar */
.mobile-search {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.mobile-search .form-control {
    border-radius: 20px;
    padding: 12px 20px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}

/* ========================================
   MOBILE ACCESSIBILITY
   ======================================== */

/* Larger touch targets for accessibility */
@media (max-width: 767.98px) {
    .btn-close {
        width: 44px;
        height: 44px;
        padding: 12px;
    }
    
    .form-check-input {
        width: 1.25em;
        height: 1.25em;
        margin-top: 0.125em;
    }
    
    .form-range {
        height: 1.5rem;
    }
    
    /* Improved focus indicators for mobile */
    .btn:focus, .form-control:focus, .form-select:focus {
        outline: 3px solid rgba(30, 58, 138, 0.3);
        outline-offset: 2px;
    }
}

/* ========================================
   DARK MODE MOBILE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    .mobile-nav-link {
        color: #e2e8f0;
    }
    
    .mobile-nav-link:hover {
        background-color: rgba(226, 232, 240, 0.1);
        color: white;
    }
    
    .mobile-search .form-control {
        background-color: #1e293b;
        border-color: #374151;
        color: white;
    }
    
    .offcanvas {
        background-color: #0f172a;
    }
    
    .offcanvas-title {
        color: white;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Hardware acceleration for smooth animations */
.mobile-nav-link, .btn, .card, .modal-dialog {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Optimize scroll performance */
.offcanvas-body, .modal-body, .table-responsive {
    will-change: scroll-position;
}

/* Reduced motion for mobile users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .mobile-nav-link, .btn, .modal-dialog {
        transition: none;
    }
    
    .modal.fade .modal-dialog {
        transition: none;
    }
}