/* Responsive Design for Safaari Transport System */

/* --- Sidebar Toggling for Mobile/Tablet --- */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed !important;
        top: 0;
        left: -280px; /* Start hidden */
        width: 280px;
        height: 100%;
        z-index: 1040;
        transition: left 0.3s ease-in-out;
        display: flex !important; /* Override Bootstrap's d-none */
        box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    }

    .sidebar.active {
        left: 0; /* Slide in */
    }

    .main-content {
        width: 100% !important; /* Take full width on mobile */
        margin-left: 0 !important;
        transition: margin-left 0.3s ease-in-out;
    }

    .sidebar-toggle-btn {
        display: inline-block; /* Show toggle button */
        color: #457c65;
        background-color: #fff;
        border: 1px solid #e0e7e6;
        margin-right: 15px;
    }

    .content-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1039; /* Below sidebar, above content */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .content-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* --- Hide Toggle on Desktop --- */
@media (min-width: 992px) {
    .sidebar-toggle-btn {
        display: none !important;
    }
}

/* --- General Responsiveness --- */
@media (max-width: 767.98px) {
    .page-title {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
        padding: 15px;
        margin: 15px;
    }
    
    .stats-card {
        text-align: center;
    }

    .stats-card .icon {
        margin: 0 auto 16px auto;
    }
    
    .dashboard-title, .page-title h1 {
        font-size: 1.5rem;
    }

    /* Make tables scrollable and better styled */
    .table-responsive {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }

    .header-bar {
        padding-top: 12px;
        padding-bottom: 12px;
    }
}

@media (max-width: 575.98px) {
    .header-bar {
        padding-left: 15px;
        padding-right: 15px;
    }
    .main-content .container, 
    .main-content .container-fluid,
    .main-content .mx-4 {
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .modal-dialog {
        padding: 10px;
    }
}

/* HCPSS input visibility fix */
@media (max-width: 576px) {
  .input-group>.form-control,
  .input-group>.form-select {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .form-control {
    min-height: 44px;
    font-size: 1rem !important;
  }

  .input-group-text {
    min-height: 44px;
    padding: 0.625rem 0.75rem;
    font-size: 1rem !important;
  }
} 