/**
 * Responsive Styles
 * Mobile-first responsive design for all screen sizes
 */

/* ============================================
   EXTRA LARGE SCREENS (1200px and above)
   ============================================ */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* ============================================
   LARGE SCREENS (992px to 1199px)
   ============================================ */
@media (max-width: 1199px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .stats-number {
        font-size: 28px;
    }
    
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.5rem; }
}

/* ============================================
   MEDIUM SCREENS (768px to 991px)
   ============================================ */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 200px;
    }
    
    .admin-sidebar .nav-link span,
    .doctor-sidebar .nav-link span {
        font-size: 12px;
    }
    
    .stats-card {
        margin-bottom: 15px;
    }
    
    .stats-number {
        font-size: 24px;
    }
    
    .rubric-children {
        margin-left: 20px;
    }
    
    .btn {
        padding: 6px 15px;
        font-size: 13px;
    }
}

/* ============================================
   TABLET SCREENS (576px to 767px)
   ============================================ */
@media (max-width: 767px) {
    .admin-sidebar,
    .doctor-sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .admin-sidebar .nav-link span,
    .doctor-sidebar .nav-link span {
        display: none;
    }
    
    .admin-sidebar .nav-link i,
    .doctor-sidebar .nav-link i {
        margin-right: 0;
        font-size: 20px;
    }
    
    .admin-main,
    .doctor-main {
        margin-left: var(--sidebar-collapsed-width);
    }
    
    .admin-sidebar .logo h4,
    .doctor-sidebar .logo h4 {
        font-size: 14px;
    }
    
    .admin-sidebar .logo small {
        display: none;
    }
    
    /* Statistics cards */
    .stats-card {
        padding: 15px;
    }
    
    .stats-number {
        font-size: 20px;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
        display: block;
    }
    
    .table {
        min-width: 600px;
    }
    
    /* Forms */
    .form-row {
        flex-direction: column;
    }
    
    .form-row .col {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Modals */
    .modal-dialog {
        width: 95%;
        margin: 10px auto;
    }
    
    /* Rubric tree */
    .rubric-children {
        margin-left: 15px;
    }
    
    .rubric-item {
        flex-wrap: wrap;
    }
    
    .remedy-list {
        margin-top: 5px;
        margin-left: 20px;
    }
}

/* ============================================
   MOBILE SCREENS (below 576px)
   ============================================ */
@media (max-width: 575px) {
    body {
        font-size: 13px;
    }
    
    .admin-main,
    .doctor-main {
        padding: 10px;
    }
    
    .top-navbar {
        padding: 10px 15px;
    }
    
    .top-navbar h4 {
        font-size: 18px;
    }
    
    /* Cards */
    .card-header,
    .card-body,
    .card-footer {
        padding: 12px;
    }
    
    /* Forms */
    .form-control {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    /* Buttons */
    .btn {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .btn-sm {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    /* Buttons group on mobile */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
    
    /* Stats cards row */
    .stats-row {
        flex-direction: column;
    }
    
    .stats-row .col {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Welcome banner */
    .welcome-banner {
        padding: 15px;
    }
    
    .welcome-banner h3 {
        font-size: 18px;
    }
    
    /* Rubric browser */
    .rubric-search-box {
        padding: 8px;
    }
    
    .rubric-search-box .input-group {
        flex-direction: column;
    }
    
    .rubric-search-box .input-group input,
    .rubric-search-box .input-group button {
        width: 100%;
        margin-bottom: 5px;
    }
    
    /* Case cards */
    .case-card {
        padding: 12px;
    }
    
    /* Modal */
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 12px;
    }
    
    .modal-header h5 {
        font-size: 16px;
    }
    
    /* Pagination */
    .pagination .page-link {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    /* Hide some columns on mobile */
    .table-mobile-hide {
        display: none;
    }
}

/* ============================================
   PRINT STYLES (overrides for mobile)
   ============================================ */
@media print {
    .sidebar,
    .top-navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .admin-main,
    .doctor-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   LANDSCAPE MODE
   ============================================ */
@media (max-width: 767px) and (orientation: landscape) {
    .admin-sidebar,
    .doctor-sidebar {
        width: var(--sidebar-width);
    }
    
    .admin-sidebar .nav-link span,
    .doctor-sidebar .nav-link span {
        display: inline;
    }
    
    .admin-main,
    .doctor-main {
        margin-left: var(--sidebar-width);
    }
}

/* ============================================
   HIGH DPI SCREENS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimizations for retina displays */
    .btn,
    .card,
    .form-control {
        border-width: 0.5px;
    }
}

/* ============================================
   DARK MODE SUPPORT (optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles - enable when needed */
    /*
    body {
        background: #1a1a2e;
        color: #eee;
    }
    
    .card,
    .stats-card {
        background: #16213e;
    }
    */
}