/* ===================================
   RESPONSIVE DESIGN FIXES
   =================================== */

/* Mobile First Approach */
@media (max-width: 575.98px) {
    /* Extra Small Devices (phones) */
    
    /* Typography */
    .display-1 { font-size: 2.5rem !important; }
    .display-2 { font-size: 2.2rem !important; }
    .display-3 { font-size: 2rem !important; }
    .display-4 { font-size: 1.8rem !important; }
    .display-5 { font-size: 1.6rem !important; }
    .display-6 { font-size: 1.4rem !important; }
    
    /* Hero Section */
    .hero-section {
        padding: 3rem 0 !important;
        min-height: auto !important;
    }
    
    .hero-content h1 {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
    }
    
    .hero-content p {
        font-size: 1rem !important;
    }
    
    /* Buttons */
    .btn-lg {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    .btn-group .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Cards */
    .card-body {
        padding: 1.5rem !important;
    }
    
    .stat-card h3 {
        font-size: 1.5rem !important;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem !important;
        vertical-align: middle;
    }
    
    /* Admin Sidebar */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 280px !important;
        height: 100vh !important;
        z-index: 1050 !important;
        transition: left 0.3s ease !important;
        background: white !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
    }
    
    .sidebar.show {
        left: 0 !important;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Admin Main Content */
    .admin-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Form Steps */
    .step-indicator {
        margin-bottom: 1rem;
    }
    
    .step-circle {
        width: 35px !important;
        height: 35px !important;
        font-size: 14px !important;
    }
    
    .step-indicator small {
        font-size: 10px !important;
    }
    
    /* Navigation */
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin-top: 0 !important;
        background-color: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }
    
    .navbar-nav .dropdown-item {
        padding: 0.5rem 1rem !important;
        color: rgba(255,255,255,0.8) !important;
    }
    
    .navbar-nav .dropdown-item:hover {
        background-color: rgba(255,255,255,0.1) !important;
        color: white !important;
    }
}

@media (max-width: 767.98px) {
    /* Small Devices (landscape phones) */
    
    /* Statistics Cards */
    .stats-row .col-md-3,
    .stats-row .col-md-4,
    .stats-row .col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* Admin Tables */
    .admin-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-table {
        min-width: 600px;
    }
    
    /* Modal */
    .modal-dialog {
        margin: 1rem !important;
    }
    
    .modal-lg {
        max-width: calc(100vw - 2rem) !important;
    }
    
    /* File Manager Grid */
    .file-grid .col-lg-2,
    .file-grid .col-lg-3,
    .file-grid .col-lg-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

@media (max-width: 991.98px) {
    /* Medium Devices (tablets) */
    
    /* Admin Layout */
    .admin-sidebar {
        margin-left: -250px;
        transition: margin-left 0.3s ease;
    }
    
    .admin-sidebar.show {
        margin-left: 0;
    }
    
    .admin-content {
        margin-left: 0 !important;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 4rem 0;
    }
    
    /* Statistics */
    .stat-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 1199.98px) {
    /* Large Devices (desktops) */
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Admin Specific Responsive Fixes */
.admin-responsive {
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: none;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1060;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 0.375rem;
        padding: 0.5rem;
        font-size: 1.2rem;
    }
    
    @media (max-width: 991.98px) {
        .mobile-menu-toggle {
            display: block;
        }
    }
}

/* Table Responsive Enhancements */
@media (max-width: 768px) {
    .table-responsive-stack {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive-stack table,
    .table-responsive-stack thead,
    .table-responsive-stack tbody,
    .table-responsive-stack th,
    .table-responsive-stack td,
    .table-responsive-stack tr {
        display: block;
    }
    
    .table-responsive-stack thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .table-responsive-stack tr {
        border: 1px solid #ccc;
        margin-bottom: 1rem;
        border-radius: 0.375rem;
        padding: 1rem;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .table-responsive-stack td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .table-responsive-stack td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: var(--primary-color);
    }
}

/* Form Responsive Fixes */
@media (max-width: 576px) {
    .form-floating {
        margin-bottom: 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .btn {
        border-radius: 0.375rem !important;
        margin-top: 0.5rem;
    }
    
    .form-check {
        margin-bottom: 1rem;
    }
}

/* Card Responsive Fixes */
@media (max-width: 768px) {
    .card-columns {
        column-count: 1 !important;
    }
    
    .card-deck .card {
        margin-bottom: 1rem;
    }
}

/* Utility Classes for Mobile */
.mobile-hide {
    @media (max-width: 767.98px) {
        display: none !important;
    }
}

.mobile-show {
    display: none !important;
    @media (max-width: 767.98px) {
        display: block !important;
    }
}

.mobile-text-center {
    @media (max-width: 767.98px) {
        text-align: center !important;
    }
}

.mobile-mb-3 {
    @media (max-width: 767.98px) {
        margin-bottom: 1rem !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .sidebar,
    .navbar,
    .btn,
    .modal {
        display: none !important;
    }
    
    .container-fluid {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}
