/* Custom styles for the Social Assistance System */

/* Base layout improvements */
body {
    background-color: var(--bs-body-bg);
    font-family: var(--bs-font-sans-serif);
}

/* Navigation enhancements */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    margin-bottom: 0;
}

.navbar-brand {
    font-weight: 600;
}

/* Card enhancements */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid var(--bs-border-color);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--bs-light);
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 500;
    color: var(--bs-dark) !important;
}

.card-header .card-title {
    color: var(--bs-dark) !important;
}

/* Ensure dark text on light backgrounds */
.bg-light,
.bg-white,
.card-header,
.table-light {
    color: var(--bs-dark) !important;
}

.bg-light *,
.bg-white *,
.card-header *,
.table-light * {
    color: var(--bs-dark) !important;
}

/* Override Bootstrap's table styling for better contrast */
.table {
    --bs-table-color: var(--bs-body-color);
    --bs-table-bg: var(--bs-body-bg);
}

/* Ensure proper contrast for table headers */
.table thead th {
    color: var(--bs-body-color) !important;
}

/* Form elements on light backgrounds */
.form-label {
    color: var(--bs-body-color) !important;
}

/* Ensure proper contrast for badges on light backgrounds */
.badge.bg-warning {
    color: var(--bs-dark) !important;
}

.badge.bg-light {
    color: var(--bs-dark) !important;
}

/* Ensure proper contrast for text in light containers */
.text-muted {
    color: var(--bs-secondary) !important;
}

/* Override any white text on light backgrounds */
.bg-light .text-white,
.bg-white .text-white,
.card-header .text-white {
    color: var(--bs-dark) !important;
}

/* Ensure dropdowns on light backgrounds have proper contrast */
.dropdown-menu {
    --bs-dropdown-color: var(--bs-dark);
    --bs-dropdown-bg: var(--bs-light);
}

/* Ensure proper contrast for list group items */
.list-group-item-light {
    color: var(--bs-dark) !important;
}

/* Alert styling for better contrast */
.alert-light {
    color: var(--bs-dark) !important;
}

/* Modal headers with light backgrounds */
.modal-header {
    color: var(--bs-dark) !important;
}

.modal-header.bg-light,
.modal-header.bg-white {
    color: var(--bs-dark) !important;
}

.modal-header.bg-light *,
.modal-header.bg-white * {
    color: var(--bs-dark) !important;
}

/* Priority badges styling */
.badge {
    font-size: 0.75em;
    padding: 0.375rem 0.75rem;
}

/* Table improvements */
.table-hover tbody tr:hover {
    background-color: var(--bs-secondary-bg);
}

/* Form styling */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Button enhancements */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-group .btn {
    border-radius: 0.375rem;
}

/* Dashboard cards */
.card .fa-2x {
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* Timeline for visits */
.timeline .card {
    border-left: 4px solid var(--bs-primary);
    margin-bottom: 1rem;
}

/* Login page styling */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 1rem;
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--bs-text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Priority indicators */
.priority-alta {
    border-left: 4px solid var(--bs-danger) !important;
}

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

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

/* Flash messages */
.alert {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

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

.cursor-pointer {
    cursor: pointer;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .card-header .dropdown {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}
