/* ========================================
   ENROLLMENT SYSTEM - RESPONSIVE DESIGN
   ========================================
   Mobile-first approach
   ======================================== */

/* ========== MOBILE (< 576px) ========== */

@media (max-width: 575.98px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 1rem;
    }

    .container-main {
        padding: 1rem 0;
    }

    /* Typography */
    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.25rem;
        margin-bottom: 0.875rem;
    }

    h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    /* Navigation */
    .navbar {
        padding: 0.75rem 0;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .nav-link {
        padding: 0.5rem !important;
        font-size: 0.9rem;
    }

    /* Cards */
    .card {
        margin-bottom: 1rem;
        border-radius: 6px;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 1rem !important;
    }

    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-control,
    .form-select {
        padding: 0.65rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Buttons */
    .btn {
        width: 100%;
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .btn-group .btn {
        width: auto;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* Tables */
    .table {
        font-size: 0.8rem;
    }

    .table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }

    .table tbody td {
        padding: 0.75rem 0.5rem;
    }

    /* Table responsiveness - stack columns */
    .table-responsive {
        font-size: 0.8rem;
    }

    .table-stacked tbody tr {
        display: block;
        border: 1px solid #ddd;
        margin-bottom: 1rem;
        border-radius: 6px;
    }

    .table-stacked tbody td {
        display: block;
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .table-stacked tbody td:before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        font-weight: 600;
        text-align: left;
    }

    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 6px;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Spacing utilities for mobile */
    .p-responsive {
        padding: 1rem;
    }

    .m-responsive {
        margin: 1rem;
    }

    /* Hide on mobile */
    .d-md-block {
        display: none !important;
    }

    .d-md-flex {
        display: none !important;
    }

    /* Show on mobile */
    .d-sm-block {
        display: block !important;
    }

    /* Badges on mobile */
    .badge {
        font-size: 0.65rem;
        padding: 0.35rem 0.5rem;
    }

    /* Alerts on mobile */
    .alert {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Page title */
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8rem;
    }

    /* Empty state */
    .empty-state {
        padding: 2rem;
    }

    .empty-state i {
        font-size: 2rem;
    }
}

/* ========== TABLET (576px - 768px) ========== */

@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        padding: 0 1.5rem;
    }

    .container-main {
        padding: 1.5rem 0;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .navbar {
        padding: 1rem 0;
    }

    .card {
        margin-bottom: 1.5rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    /* Buttons */
    .btn {
        width: auto;
    }

    /* Tables */
    .table {
        font-size: 0.9rem;
    }

    .table thead th {
        padding: 0.875rem;
    }

    .table tbody td {
        padding: 0.875rem;
    }

    /* Two column layout */
    .col-md-6 {
        width: 50%;
    }

    .page-title {
        font-size: 1.75rem;
    }
}

/* ========== DESKTOP (768px - 1199px) ========== */

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }

    .container-main {
        padding: 2rem 0;
    }

    h1 {
        font-size: 2rem;
    }

    .navbar {
        padding: 1rem 0;
    }

    .card {
        margin-bottom: 2rem;
    }

    /* Hide on desktop */
    .d-md-none {
        display: none !important;
    }

    /* Show on desktop */
    .d-md-block {
        display: block !important;
    }

    .d-md-flex {
        display: flex !important;
    }

    /* Three column layout */
    .col-md-4 {
        width: 33.333%;
    }

    .col-md-6 {
        width: 50%;
    }

    .col-md-8 {
        width: 66.666%;
    }

    /* Sidebar layout */
    .sidebar {
        position: sticky;
        top: 1rem;
    }
}

/* ========== LARGE DESKTOP (> 1200px) ========== */

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
        margin: 0 auto;
    }

    .container-main {
        padding: 3rem 0;
    }

    h1 {
        font-size: 2.5rem;
    }

    .card {
        margin-bottom: 2.5rem;
    }

    /* Four column layout */
    .col-lg-3 {
        width: 25%;
    }

    .col-lg-6 {
        width: 50%;
    }

    .col-lg-9 {
        width: 75%;
    }

    /* Flex utilities */
    .d-lg-flex {
        display: flex !important;
    }
}

/* ========== LANDSCAPE ORIENTATION ========== */

@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        padding: 0.5rem 0;
    }

    .container-main {
        padding: 1rem 0;
    }

    .card {
        margin-bottom: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }
}

/* ========== PRINT STYLES ========== */

@media print {
    .navbar,
    footer,
    .no-print,
    .btn,
    .action-buttons,
    .modal {
        display: none !important;
    }

    body {
        background-color: white;
        color: black;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .table {
        width: 100%;
    }

    a {
        color: #0066cc;
        text-decoration: none;
    }

    .page-break {
        page-break-after: always;
    }

    .print-break {
        page-break-after: always;
    }
}

/* ========== DARK MODE (Future) ========== */

@media (prefers-color-scheme: dark) {
    /* Will be implemented for dark mode support */
    /*
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    */
}

/* ========== HIGH RESOLUTION DISPLAYS ========== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Thinner borders for high DPI */
    .border {
        border-width: 0.5px;
    }
}

/* ========== REDUCED MOTION ========== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== ACCESSIBILITY ========== */

@media (prefers-contrast: more) {
    :root {
        --primary-color: #1a1a1a;
        --secondary-color: #0066ff;
    }

    .text-muted {
        color: #333 !important;
    }
}
