/* Healthcare Data Management - Custom Styles */

/* ========================================
   Loading Overlay Styles
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    color: var(--bs-light);
}

/* ========================================
   Connection Status Indicator
   ======================================== */
.connection-status .badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.connection-status .badge svg {
    width: 1rem;
    height: 1rem;
}

/* ========================================
   Enhanced Card Styles
   ======================================== */
.card {
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--bs-gray-900);
    border-bottom: 1px solid var(--bs-border-color);
}

/* ========================================
   Table Enhancements
   ======================================== */
.table-responsive {
    border-radius: 0.375rem;
}

.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: var(--bs-table-hover-bg) !important;
}

/* ========================================
   Form Enhancements
   ======================================== */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    font-size: 0.75rem;
    color: var(--bs-secondary);
}

/* Required field indicator */
.text-danger {
    color: var(--bs-danger) !important;
}

/* ========================================
   Button Enhancements
   ======================================== */
.btn {
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
}

.btn-group-sm .btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* ========================================
   Badge Styles
   ======================================== */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
}

.badge svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* ========================================
   Navigation Enhancements
   ======================================== */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-brand svg {
    width: 1.5rem;
    height: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.15s ease-in-out;
}

.nav-link svg {
    width: 1rem;
    height: 1rem;
}

.nav-link:hover {
    color: var(--bs-primary) !important;
}

/* ========================================
   Alert Enhancements
   ======================================== */
.alert {
    border: none;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
}

.alert svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--bs-success);
    border-left: 4px solid var(--bs-success);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--bs-danger);
    border-left: 4px solid var(--bs-danger);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--bs-warning);
    border-left: 4px solid var(--bs-warning);
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: var(--bs-info);
    border-left: 4px solid var(--bs-info);
}

/* ========================================
   Modal Enhancements
   ======================================== */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
    background-color: var(--bs-gray-900);
}

.modal-footer {
    border-top: 1px solid var(--bs-border-color);
    background-color: var(--bs-gray-900);
}

/* ========================================
   Pagination Enhancements
   ======================================== */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.page-link:hover {
    color: var(--bs-primary);
    background-color: var(--bs-gray-800);
    border-color: var(--bs-primary);
}

.page-link svg {
    width: 1rem;
    height: 1rem;
}

.page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.page-item.disabled .page-link {
    color: var(--bs-secondary);
    background-color: transparent;
    border-color: var(--bs-border-color);
    opacity: 0.6;
}

/* ========================================
   Footer Enhancements
   ======================================== */
footer {
    margin-top: auto;
    background-color: var(--bs-gray-900) !important;
}

footer .text-muted {
    display: flex;
    align-items: center;
}

footer svg {
    width: 1rem;
    height: 1rem;
}

/* ========================================
   Empty State Styles
   ======================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: var(--bs-body-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--bs-secondary);
    margin-bottom: 1.5rem;
}

/* ========================================
   Chart Container Enhancements
   ======================================== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container canvas {
    max-height: 300px;
}

/* ========================================
   Search and Filter Enhancements
   ======================================== */
.search-form {
    background-color: var(--bs-gray-900);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.search-form .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* ========================================
   Statistics Display
   ======================================== */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.stat-card .display-6 {
    font-weight: 700;
    color: var(--bs-body-color);
}

.stat-card .text-muted {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

/* ========================================
   Data Form Enhancements
   ======================================== */
.form-section-header {
    border-bottom: 2px solid var(--bs-border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.form-section-header svg {
    width: 1.25rem;
    height: 1.25rem;
}

.form-section-header h5 {
    margin: 0;
    font-weight: 600;
}

/* ========================================
   Responsive Utilities
   ======================================== */
@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .display-6 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.125rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .pagination {
        justify-content: center;
    }
    
    .page-link {
        padding: 0.375rem 0.75rem;
    }
}

/* ========================================
   Accessibility Enhancements
   ======================================== */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus styles for better accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--bs-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .navbar,
    .btn,
    .alert,
    .modal,
    .loading-overlay {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .table {
        border-collapse: collapse;
    }
    
    .table th,
    .table td {
        border: 1px solid #000;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}

/* ========================================
   Animation Utilities
   ======================================== */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-start-primary {
    border-left: 4px solid var(--bs-primary) !important;
}

.border-start-success {
    border-left: 4px solid var(--bs-success) !important;
}

.border-start-danger {
    border-left: 4px solid var(--bs-danger) !important;
}

.border-start-warning {
    border-left: 4px solid var(--bs-warning) !important;
}

.border-start-info {
    border-left: 4px solid var(--bs-info) !important;
}

/* Spacing utilities for better consistency */
.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

.gap-4 {
    gap: 1.5rem !important;
}
