/* Global Responsive Styles for ASMS */

/* Mobile First Approach */
/* Base styles for mobile devices */

/* Tablet Styles */
@media (min-width: 768px) {
    .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn-group {
        flex-wrap: nowrap;
    }
}

/* Desktop Styles */
@media (min-width: 992px) {
    .container-fluid {
        padding-left: 30px;
        padding-right: 30px;
    }
    
    .table-responsive {
        font-size: 1rem;
    }
}

/* Mobile Specific Styles */
@media (max-width: 767px) {
    /* Typography */
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.3rem; }
    h3, .h3 { font-size: 1.2rem; }
    h4, .h4 { font-size: 1.1rem; }
    h5, .h5 { font-size: 1rem; }
    h6, .h6 { font-size: 0.9rem; }
    
    /* Cards */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .table td, .table th {
        padding: 0.5rem 0.25rem;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Forms */
    .form-control, .form-select {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 1rem 0.75rem;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1rem;
    }
    
    /* Sidebar */
    .sidebar {
        width: 100%;
        max-width: 280px;
    }
    
    /* Utility Classes */
    .d-mobile-none {
        display: none !important;
    }
    
    .d-mobile-block {
        display: block !important;
    }
    
    .d-mobile-flex {
        display: flex !important;
    }
    
    /* Spacing */
    .mb-mobile-2 {
        margin-bottom: 0.5rem !important;
    }
    
    .mb-mobile-3 {
        margin-bottom: 1rem !important;
    }
    
    .p-mobile-2 {
        padding: 0.5rem !important;
    }
    
    .p-mobile-3 {
        padding: 1rem !important;
    }
}

/* Small Mobile Devices */
@media (max-width: 575px) {
    /* Typography */
    h1, .h1 { font-size: 1.3rem; }
    h2, .h2 { font-size: 1.2rem; }
    h3, .h3 { font-size: 1.1rem; }
    
    /* Cards */
    .card-body {
        padding: 0.75rem 0.5rem;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table td, .table th {
        padding: 0.375rem 0.125rem;
    }
    
    /* Buttons */
    .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }
    
    .btn-sm {
        font-size: 0.7rem;
        padding: 0.2rem 0.375rem;
    }
    
    /* Forms */
    .form-control, .form-select {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .modal-body {
        padding: 0.75rem 0.5rem;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    /* Utility Classes */
    .text-small-mobile {
        font-size: 0.75rem !important;
    }
    
    .text-xs-mobile {
        font-size: 0.7rem !important;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .modal,
    .no-print {
        display: none !important;
    }
    
    .main {
        margin-left: 0 !important;
    }
    
    .content {
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .table {
        font-size: 0.8rem !important;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo,
    .icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: #e2e8f0;
    }
    
    .table {
        color: #e2e8f0;
    }
    
    .table-light {
        background-color: #4a5568;
    }
}

/* Landscape Orientation */
@media (max-width: 767px) and (orientation: landscape) {
    .sidebar {
        width: 250px;
    }
    
    .main {
        margin-left: 250px;
    }
    
    .modal-dialog {
        margin: 0.5rem auto;
        max-width: 90%;
    }
}

/* Specific Component Responsive Styles */

/* Admin Panel */
@media (max-width: 767px) {
    .admin-student-table th:nth-child(n+4),
    .admin-student-table td:nth-child(n+4) {
        display: none;
    }
    
    .admin-student-table th:nth-child(3),
    .admin-student-table td:nth-child(3) {
        border-right: none;
    }
}

/* Management Panel */
@media (max-width: 767px) {
    .report-card .row {
        flex-direction: column;
    }
    
    .report-card .col-md-6 {
        margin-bottom: 0.5rem;
    }
}

/* Teacher Panel */
@media (max-width: 767px) {
    .teacher-dashboard .row {
        flex-direction: column;
    }
    
    .teacher-dashboard .col-md-6 {
        margin-bottom: 1rem;
    }
}

/* Student/Parent Panel */
@media (max-width: 767px) {
    .student-dashboard .quick-action-btn,
    .parent-dashboard .quick-action-btn {
        min-height: 70px;
        padding: 0.75rem;
    }
    
    .student-dashboard .stat-card,
    .parent-dashboard .stat-card {
        margin-bottom: 1rem;
    }
}

/* Performance Charts */
@media (max-width: 767px) {
    .performance-chart {
        height: 200px !important;
    }
    
    .chart-container {
        padding: 0.5rem;
    }
}

/* Data Tables */
@media (max-width: 767px) {
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
    }
}

/* Form Responsiveness */
@media (max-width: 767px) {
    .form-row .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.25rem;
    }
}

/* Loading States */
@media (max-width: 767px) {
    .loading-spinner {
        width: 2rem;
        height: 2rem;
    }
    
    .loading-text {
        font-size: 0.875rem;
    }
}

/* Error States */
@media (max-width: 767px) {
    .alert {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
    
    .alert-dismissible .btn-close {
        padding: 0.75rem;
    }
}

/* Success States */
@media (max-width: 767px) {
    .toast {
        font-size: 0.875rem;
        max-width: calc(100% - 2rem);
    }
}

/* Custom Breakpoints */
@media (max-width: 480px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (max-width: 360px) {
    .container-fluid {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .card-body {
        padding: 0.375rem;
    }
    
    .btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.375rem;
    }
}
