/**
 * OutageScout Custom CSS Extensions
 *
 * Extends the base OutageScout theme (outagescout_theme_25.css)
 * with Bootstrap-compatible utilities and additional components
 */

/* ===== Bootstrap Integration with OutageScout Theme ===== */

/* Make Bootstrap components work with OutageScout colors */
.btn-primary {
    background: linear-gradient(135deg, var(--os-primary-blue) 0%, var(--os-primary-green) 100%) !important;
    border: none !important;
    color: white !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--os-primary-blue-dark) 0%, var(--os-primary-green-dark) 100%) !important;
    transform: translateY(-2px);
    box-shadow: var(--os-shadow-md);
}

.bg-primary {
    background: linear-gradient(135deg, var(--os-primary-blue) 0%, var(--os-primary-green) 100%) !important;
}

.text-primary {
    color: var(--os-primary-blue) !important;
}

/* ===== Bootstrap Navbar Integration ===== */
.navbar-dark .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* ===== Bootstrap Cards with OutageScout Style ===== */
.card {
    border: none !important;
    border-radius: var(--os-border-radius) !important;
    box-shadow: var(--os-shadow-sm) !important;
    background: var(--os-bg-card) !important;
}

.card:hover {
    box-shadow: var(--os-shadow-md) !important;
}

.card-header {
    background: var(--os-bg-header) !important;
    border: none !important;
    border-radius: var(--os-border-radius) var(--os-border-radius) 0 0 !important;
}

/* ===== Bootstrap Alerts with OutageScout Style ===== */
.alert {
    border-radius: var(--os-border-radius) !important;
    border: none !important;
    box-shadow: var(--os-shadow-sm) !important;
}

.alert-success {
    background: linear-gradient(135deg, var(--os-success) 0%, var(--os-success-dark) 100%) !important;
    color: white !important;
}

.alert-danger {
    background: linear-gradient(135deg, var(--os-error) 0%, var(--os-error-dark) 100%) !important;
    color: white !important;
}

.alert-warning {
    background: linear-gradient(135deg, var(--os-warning-bg) 0%, #e0a800 100%) !important;
    color: #212529 !important;
}

.alert-info {
    background: linear-gradient(135deg, var(--os-info) 0%, var(--os-info-dark) 100%) !important;
    color: white !important;
}

/* ===== Bootstrap Forms with OutageScout Style ===== */
.form-control {
    border-radius: var(--os-border-radius) !important;
    border: 2px solid var(--os-border-primary) !important;
    transition: var(--os-transition) !important;
}

.form-control:focus {
    border-color: var(--os-border-focus) !important;
    box-shadow: 0 0 0 0.2rem rgba(54, 142, 255, 0.25) !important;
}

.form-label {
    font-weight: 600 !important;
    color: var(--os-text-primary) !important;
}

/* ===== Bootstrap Buttons with OutageScout Style ===== */
.btn {
    border-radius: var(--os-border-radius) !important;
    font-weight: 600 !important;
    transition: var(--os-transition) !important;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--os-shadow-sm);
}

.btn-success {
    background: linear-gradient(135deg, var(--os-success) 0%, var(--os-success-dark) 100%) !important;
    border: none !important;
    color: white !important;
}

.btn-danger {
    background: linear-gradient(135deg, var(--os-error) 0%, var(--os-error-dark) 100%) !important;
    border: none !important;
    color: white !important;
}

/* ===== Bootstrap Tables with OutageScout Style ===== */
.table {
    background: var(--os-bg-card) !important;
}

.table thead th {
    background: var(--os-bg-card) !important;
    border-bottom: 2px solid var(--os-primary-blue) !important;
    font-weight: 600 !important;
    color: var(--os-text-primary) !important;
}

.table tbody tr:hover {
    background: rgba(54, 142, 255, 0.05) !important;
}

/* ===== jQuery UI with OutageScout Style ===== */
.ui-datepicker-header {
    background: var(--os-bg-header) !important;
    color: white !important;
}

.ui-state-active {
    background: var(--os-primary-blue) !important;
    border-color: var(--os-primary-blue) !important;
}

.ui-slider-handle {
    background: var(--os-primary-blue) !important;
}

.ui-progressbar-value {
    background: linear-gradient(135deg, var(--os-primary-blue) 0%, var(--os-primary-green) 100%) !important;
}

/* ===== Utility Classes ===== */
.shadow-sm {
    box-shadow: var(--os-shadow-sm) !important;
}

.shadow {
    box-shadow: var(--os-shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--os-shadow-lg) !important;
}

/* ===== Alerts Container (for dynamic alerts) ===== */
#alerts-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

#alerts-container .alert {
    margin-bottom: 10px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.loading-overlay .os-spinner {
    width: 60px;
    height: 60px;
    border-width: 5px;
}

/* ===== Badge Extensions ===== */
.badge {
    font-weight: 600 !important;
    padding: 0.4em 0.8em !important;
    border-radius: var(--os-border-radius) !important;
}

.badge-primary {
    background: var(--os-primary-blue) !important;
    color: white !important;
}

.badge-success {
    background: var(--os-success) !important;
    color: white !important;
}

.badge-danger {
    background: var(--os-error) !important;
    color: white !important;
}

.badge-warning {
    background: var(--os-warning-bg) !important;
    color: #212529 !important;
}

/* ===== Modal Styling ===== */
.modal-content {
    border-radius: var(--os-border-radius-lg) !important;
    border: none !important;
    box-shadow: var(--os-shadow-lg) !important;
}

.modal-header {
    background: var(--os-bg-header) !important;
    color: white !important;
    border-bottom: none !important;
    border-radius: var(--os-border-radius-lg) var(--os-border-radius-lg) 0 0 !important;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-footer {
    border-top: 1px solid var(--os-border-light) !important;
}

/* ===== Pagination ===== */
.pagination .page-link {
    border-radius: var(--os-border-radius) !important;
    margin: 0 3px !important;
    border: 2px solid var(--os-border-primary) !important;
    color: var(--os-primary-blue) !important;
}

.pagination .page-link:hover {
    background: var(--os-primary-blue) !important;
    border-color: var(--os-primary-blue) !important;
    color: white !important;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--os-primary-blue) 0%, var(--os-primary-green) 100%) !important;
    border-color: transparent !important;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    background: var(--os-bg-card) !important;
    border-radius: var(--os-border-radius) !important;
    padding: 0.75rem 1rem !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--os-text-muted) !important;
}

.breadcrumb-item.active {
    color: var(--os-primary-blue) !important;
    font-weight: 600 !important;
}

/* ===== Dropdown Menu ===== */
.dropdown-menu {
    border-radius: var(--os-border-radius) !important;
    border: none !important;
    box-shadow: var(--os-shadow-md) !important;
}

.dropdown-item:hover {
    background: var(--os-bg-card) !important;
    color: var(--os-primary-blue) !important;
}

/* ===== Progress Bar ===== */
.progress {
    border-radius: var(--os-border-radius) !important;
    background: var(--os-bg-card) !important;
}

.progress-bar {
    background: linear-gradient(135deg, var(--os-primary-blue) 0%, var(--os-primary-green) 100%) !important;
}

/* ===== List Group ===== */
.list-group-item {
    border: 1px solid var(--os-border-light) !important;
    transition: var(--os-transition) !important;
}

.list-group-item:hover {
    background: var(--os-bg-card) !important;
}

.list-group-item.active {
    background: linear-gradient(135deg, var(--os-primary-blue) 0%, var(--os-primary-green) 100%) !important;
    border-color: transparent !important;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    #alerts-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    footer,
    .btn,
    .no-print {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}
