/* Fyleon Design System Overrides */

/* Brand Colors from Design System */
:root {
    --fyleon-primary: #667eea;
    --fyleon-secondary: #764ba2;
    --fyleon-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --fyleon-light-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --fyleon-footer-gradient: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

/* Force light theme colors */
:root, [data-bs-theme=light] {
    --bs-body-bg: #f8f9fa;
    --bs-body-color: #212529;
    --bs-primary: var(--fyleon-primary);
    --bs-secondary: var(--fyleon-secondary);
}

/* Layout improvements */
body {
    background-color: #f8f9fa;
    color: #212529;
}

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

.navbar-brand i {
    margin-right: 0.5rem;
}

/* Card enhancements from Design System */
.card {
    border: 0;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    background-color: white;
}

.card-header-gradient {
    background: var(--fyleon-gradient);
    color: white;
    border: 0;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

.card-body .d-flex i[data-feather] {
    width: 2rem;
    height: 2rem;
    opacity: 0.7;
}

/* Button improvements from Design System */
.btn-primary {
    background: var(--fyleon-gradient);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd3 0%, #6a3f91 100%);
    border: none;
}

.btn-outline-secondary {
    border-color: #dee2e6;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #212529;
}

.btn {
    border-radius: 0.375rem;
}

.btn i[data-feather] {
    width: 1rem;
    height: 1rem;
    margin-right: 0.25rem;
}

.btn-sm i[data-feather] {
    width: 0.875rem;
    height: 0.875rem;
}

/* Table improvements */
.table {
    background-color: white !important;
    color: #212529 !important;
}

.table th {
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.table td {
    vertical-align: middle;
    color: #212529 !important;
    background-color: white !important;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa !important;
}

.table-hover tbody tr:hover td {
    background-color: #f8f9fa !important;
}

/* Badge improvements */
.badge {
    font-size: 0.75em;
    font-weight: 500;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
}

.badge i[data-feather] {
    width: 0.75rem;
    height: 0.75rem;
    margin-right: 0.25rem;
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert i[data-feather] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

/* Modal improvements */
.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
}

.modal-title i[data-feather] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

/* Fix for edit modal visibility */
#editMatterModal {
    z-index: 1060 !important;
}

#editMatterModal .modal-dialog {
    z-index: 1061 !important;
    margin: 1.75rem auto;
}

#editMatterModal .modal-content {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    background-color: white !important;
    background-clip: padding-box !important;
    border: 1px solid rgba(0,0,0,.2) !important;
    border-radius: .3rem !important;
    outline: 0 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

.modal.show .modal-dialog {
    transform: none !important;
}

/* Navigation improvements */
.nav-link i[data-feather] {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card-body .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-body .d-flex i[data-feather] {
        margin-bottom: 0.5rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
}

/* Code and technical content */
code {
    background-color: var(--bs-gray-100);
    color: var(--bs-gray-800);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator i[data-feather] {
    width: 1rem;
    height: 1rem;
}

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

.empty-state i[data-feather] {
    width: 4rem;
    height: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* File listings */
.file-list .list-group-item {
    border: none;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.file-list .list-group-item:last-child {
    border-bottom: none;
}

.file-list i[data-feather] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    opacity: 0.7;
}

/* Institution headers */
.institution-header {
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-info));
    color: white;
    padding: 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

.institution-header h5 {
    margin: 0;
}

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

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--bs-primary);
}

.stat-card .stat-label {
    color: var(--bs-gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Light theme adjustments */
body {
    background-color: #f8f9fa;
}

.navbar {
    background-color: #ffffff !important;
}

.card {
    background-color: #ffffff;
    border: 1px solid rgba(0,0,0,.125);
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,.025);
}

/* Fyleon Design System Additional Styles */

/* Rounded buttons for design system */
.btn.rounded-pill {
    border-radius: 50rem !important;
}

/* Primary button gradient override for all states */
.btn-primary, .btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--fyleon-gradient) !important;
    border: none !important;
    box-shadow: 0 0.125rem 0.25rem rgba(102, 126, 234, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd3 0%, #6a3f91 100%) !important;
    box-shadow: 0 0.25rem 0.5rem rgba(102, 126, 234, 0.35);
}

/* Outline button improvements */
.btn-outline-primary {
    color: var(--fyleon-primary);
    border-color: var(--fyleon-primary);
}

.btn-outline-primary:hover {
    background-color: rgba(102, 126, 234, 0.1);
    border-color: var(--fyleon-primary);
    color: var(--fyleon-primary);
}

/* Table header styling */
thead th {
    background: #f8f9fa !important;
    color: #212529 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #dee2e6 !important;
}

/* Icon container styling */
.rounded-circle.bg-primary.bg-opacity-20 {
    background-color: rgba(102, 126, 234, 0.2) !important;
}

/* Search input group styling */
.input-group-text {
    background-color: white;
    border-color: #dee2e6;
    color: #6c757d;
}

/* Form select styling */
.form-select {
    border-color: #dee2e6;
    background-color: white;
}

.form-select:focus {
    border-color: var(--fyleon-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Matter card specific styling */
.matter-card {
    transition: transform 0.2s ease-in-out;
}

.matter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Override any remaining dark theme defaults */
body, 
.card,
.table,
.modal-content,
.dropdown-menu,
.form-control,
.form-select,
.input-group-text {
    background-color: white !important;
    color: #212529 !important;
}

.navbar {
    background-color: white !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Ensure all text is dark on light backgrounds */
.text-muted {
    color: #6c757d !important;
}

/* Light borders throughout */
.border,
.border-bottom,
.border-top,
.border-start,
.border-end {
    border-color: #dee2e6 !important;
}

/* Light theme form controls */
.form-control,
.form-select {
    background-color: white !important;
    border-color: #dee2e6 !important;
    color: #212529 !important;
}

.form-control:focus,
.form-select:focus {
    background-color: white !important;
    border-color: var(--fyleon-primary) !important;
    color: #212529 !important;
}
