/* ===================================
   Bootstrap Integration CSS
   MBA Paglaum Insurance Management
   ================================== */

/* Override Bootstrap primary colors to match theme */
:root {
    --bs-primary: #000172;
    --bs-primary-rgb: 0, 1, 114;
    --bs-secondary: #4d4dff;
    --bs-secondary-rgb: 77, 77, 255;
    --bs-success: #10b981;
    --bs-success-rgb: 16, 185, 129;
    --bs-info: #3b82f6;
    --bs-info-rgb: 59, 130, 246;
    --bs-warning: #f59e0b;
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger: #ef4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-light: #f9fafb;
    --bs-light-rgb: 249, 250, 251;
    --bs-dark: #1f2937;
    --bs-dark-rgb: 31, 41, 55;
    
    /* Border radius */
    --bs-border-radius: 0.5rem;
    --bs-border-radius-sm: 0.375rem;
    --bs-border-radius-lg: 0.75rem;
    --bs-border-radius-xl: 1rem;
    
    /* Font */
    --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Make Bootstrap container work with our layout */
.site-container .container,
.site-container .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Enhance Bootstrap buttons to match theme */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: var(--bs-border-radius);
    transition: all 0.3s ease;
    border: none;
    text-transform: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #000172 0%, #0001a2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #000052 0%, #000172 100%);
    color: white;
}

.btn-sm,
.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

/* Bootstrap Cards with theme styling */
.card {
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    background: white;
}

.card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #000172 0%, #0001a2 100%);
    color: white;
    font-weight: 600;
    border-radius: var(--bs-border-radius-lg) var(--bs-border-radius-lg) 0 0 !important;
    border-bottom: none;
}

.card-body {
    padding: 1.5rem;
}

/* Bootstrap Tables */
.table {
    background: white;
    border-radius: var(--bs-border-radius);
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #000172 0%, #0001a2 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.table tbody tr:hover {
    background: #f9fafb;
    transform: scale(1.01);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(102, 126, 234, 0.02);
}

/* Bootstrap Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: var(--bs-border-radius-xl);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bootstrap Forms */
.form-control,
.form-select {
    border: 2px solid #e5e7eb;
    border-radius: var(--bs-border-radius);
    padding: 0.625rem 1rem;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #000172;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

/* Bootstrap Alerts */
.alert {
    border: none;
    border-radius: var(--bs-border-radius);
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.alert-danger,
.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Bootstrap Modal */
.modal-content {
    border: none;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
    background: linear-gradient(135deg, #000172 0%, #0001a2 100%);
    color: white;
    border-radius: var(--bs-border-radius-lg) var(--bs-border-radius-lg) 0 0;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 2rem;
}

/* Bootstrap Dropdown */
.dropdown-menu {
    border: none;
    border-radius: var(--bs-border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #000172;
}

/* Bootstrap Nav Tabs */
.nav-tabs {
    border-bottom: 2px solid #e5e7eb;
}

.nav-tabs .nav-link {
    color: #6b7280;
    font-weight: 600;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #000172;
    border-bottom-color: #000172;
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: #000172;
    border-bottom-color: #000172;
    background: transparent;
}

/* Bootstrap Pagination */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border: 2px solid #e5e7eb;
    color: #000172;
    border-radius: var(--bs-border-radius);
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: #000172;
    border-color: #000172;
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #000172 0%, #0001a2 100%);
    border-color: #000172;
}

/* Bootstrap Progress */
.progress {
    height: 1.5rem;
    border-radius: var(--bs-border-radius-xl);
    background-color: #f3f4f6;
}

.progress-bar {
    background: linear-gradient(135deg, #000172 0%, #0001a2 100%);
    border-radius: var(--bs-border-radius-xl);
    font-weight: 600;
}

/* Bootstrap Breadcrumb */
.breadcrumb {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--bs-border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #9ca3af;
}

.breadcrumb-item.active {
    color: #000172;
    font-weight: 600;
}

/* Bootstrap Spinner */
.spinner-border {
    border-color: rgba(102, 126, 234, 0.2);
    border-right-color: #000172;
}

/* Bootstrap Tooltip */
.tooltip-inner {
    background: #1f2937;
    border-radius: var(--bs-border-radius);
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* Bootstrap Collapse */
.accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.accordion-button {
    background: white;
    color: #1f2937;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #000172 0%, #0001a2 100%);
    color: white;
    box-shadow: none;
}

.accordion-button:focus {
    border-color: #000172;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.75rem;
    }
}

/* Utility classes to work with existing theme */
.bg-gradient-primary {
    background: linear-gradient(135deg, #000172 0%, #0001a2 100%) !important;
}

.text-gradient {
    background: linear-gradient(135deg, #000172 0%, #0001a2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Fix for notice/alert compatibility */
.notice {
    padding: 1rem 1.5rem;
    border-radius: var(--bs-border-radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
    border: none;
}

.notice-success {
    background-color: #d1fae5;
    color: #065f46;
}

.notice-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.notice-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.notice-info {
    background-color: #dbeafe;
    color: #1e40af;
}
