/* ============================================================================
   BOOTSTRAP 5 RESPONSIVE FIXES FOR PRO SYSTEM
   ============================================================================ */

/* CSS Custom Properties */
:root {
    --primary-color: #AC121C;
    --light-color: #000000;
    --gray-color: #8D8B8B;
    --white-color: #FFFFFF;
    --teal-color: #338467;
    --rose-color: #E59CA1;
}

/* ============================================================================
   RESPONSIVE LAYOUT FIXES
   ============================================================================ */

/* Mobile-first responsive adjustments */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .sidebar {
        display: none !important;
    }
    
    .mobile-menu-btn {
        display: block !important;
    }
}

@media (min-width: 992px) {
    .mobile-menu-btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
    }
}

/* Mobile spacing and typography */
@media (max-width: 575.98px) {
    body {
        font-size: 0.9rem;
    }
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
        min-height: 38px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .py-4 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* ============================================================================
   RESPONSIVE COMPONENTS
   ============================================================================ */

/* Responsive Tables */
.table-responsive {
    border-radius: 0.375rem;
    overflow-x: auto;
}

@media (max-width: 767.98px) {
    .table .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .table .btn-group .btn {
        margin-bottom: 0.25rem;
        border-radius: 0.25rem !important;
        width: 100%;
    }
    
    .table .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* Responsive Forms */
.form-control,
.form-select {
    font-size: 1rem;
    padding: 0.75rem;
}

@media (max-width: 575.98px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.625rem;
    }
    
    .input-group .btn {
        padding: 0.625rem 1rem;
    }
}

/* Responsive Cards */
.card {
    margin-bottom: 1.5rem;
}

@media (max-width: 575.98px) {
    .card {
        margin-bottom: 1rem;
        border-radius: 6px;
    }
}

/* Responsive Modals */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
}

.sidebar-logo img {
    max-width: 180px;
    width: 100%;
    height: auto;
}

@media (max-width: 575.98px) {
    .sidebar-logo img {
        max-width: 120px;
    }
}

/* Responsive Badges and Alerts */
@media (max-width: 575.98px) {
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* ============================================================================
   RESPONSIVE UTILITIES
   ============================================================================ */

/* Mobile-friendly button groups */
@media (max-width: 575.98px) {
    .btn-mobile-stack .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-mobile-stack .btn:last-child {
        margin-bottom: 0;
    }
}

/* Responsive text alignment */
@media (max-width: 575.98px) {
    .text-mobile-center {
        text-align: center !important;
    }
}

/* Hide/show elements responsively */
.mobile-only {
    display: none;
}

@media (max-width: 991.98px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .sidebar,
    .mobile-menu-btn,
    .btn,
    .alert,
    .offcanvas {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
        break-inside: avoid;
    }
    
    .table {
        font-size: 0.8rem;
    }
}
