/* Responsive Design for UKT PSHT System */

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .dashboard-stats .card-title {
        font-size: 3rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .dashboard-stats .card-title {
        font-size: 2.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    .dashboard-stats .card-title {
        font-size: 2rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .card-stats {
        padding: 15px;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    .dashboard-stats .card-title {
        font-size: 1.8rem;
    }
    
    .card-stats {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 5px 10px;
        font-size: 0.85rem;
    }
    
    .form-control, .form-select {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .dashboard-stats .card-title {
        font-size: 1.5rem;
    }
    
    .card-stats {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 4px 8px;
        font-size: 0.8rem;
        margin-bottom: 5px;
    }
    
    .form-control, .form-select {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.3rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .card-header {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .badge {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}

/* Mobile-specific optimizations */
@media (max-width: 480px) {
    .d-flex {
        flex-direction: column;
    }
    
    .d-flex .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .table td, .table th {
        padding: 0.5rem;
    }
    
    .card {
        margin-bottom: 10px;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-size: 1.2em;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .img-thumbnail {
        max-width: 100px;
        height: auto;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar-collapse {
        max-height: 200px;
        overflow-y: auto;
    }
    
    .table-responsive {
        max-height: 300px;
        overflow-y: auto;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
        margin-bottom: 20px;
    }
    
    .table {
        border: 1px solid #000;
    }
    
    .table th, .table td {
        border: 1px solid #000 !important;
        padding: 5px;
    }
    
    .btn {
        display: none;
    }
    
    .alert {
        border: 1px solid #000;
        background: white !important;
        color: black !important;
    }
    
    @page {
        margin: 1cm;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #ecf0f1;
        --light-bg: #2c3e50;
        --dark-bg: #34495e;
    }
    
    body {
        background-color: #1a1a1a;
        color: #ecf0f1;
    }
    
    .card {
        background-color: #2c3e50;
        color: #ecf0f1;
    }
    
    .form-control, .form-select {
        background-color: #34495e;
        color: #ecf0f1;
        border-color: #7f8c8d;
    }
    
    .table {
        background-color: #2c3e50;
        color: #ecf0f1;
    }
    
    .table thead th {
        background: linear-gradient(135deg, #34495e, #2c3e50);
    }
}