/* =========================================================================
   AtlasPortal — Bootstrap 5 overrides.
   Bound to `--ap-*` design tokens so consumers can theme further without
   editing this file.
   ========================================================================= */

:root {
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-secondary: #64748b;
    --bs-secondary-rgb: 100, 116, 139;
    --bs-success: #059669;
    --bs-success-rgb: 5, 150, 105;
    --bs-info: #0891b2;
    --bs-info-rgb: 8, 145, 178;
    --bs-warning: #d97706;
    --bs-warning-rgb: 217, 119, 6;
    --bs-danger: #dc2626;
    --bs-danger-rgb: 220, 38, 38;
    --bs-light: #f8fafc;
    --bs-light-rgb: 248, 250, 252;
    --bs-dark: #1e293b;
    --bs-dark-rgb: 30, 41, 59;
}

.btn-primary {
    background-color: var(--ap-primary);
    border-color: var(--ap-primary);
    box-shadow: var(--ap-shadow);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--ap-primary-dark);
    border-color: var(--ap-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
    border-radius: 0.5rem;
}

.card {
    border: none;
    box-shadow: var(--ap-shadow);
    border-radius: 0.75rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-header {
    background-color: var(--ap-surface);
    border-bottom: 1px solid var(--ap-border);
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

.form-control {
    border: 1px solid var(--ap-border);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--ap-primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.form-control-lg {
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    border-radius: 0.5rem;
}

.form-select {
    border: 1px solid var(--ap-border);
    border-radius: 0.5rem;
}

.form-select:focus {
    border-color: var(--ap-primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.table {
    border-radius: 0.75rem;
    overflow: hidden;
}

.table thead th {
    background-color: var(--ap-background);
    border-bottom: 2px solid var(--ap-border);
    font-weight: 600;
    color: var(--ap-text-primary);
}

.table-hover tbody tr:hover {
    background-color: var(--ap-background);
}

.modal-content {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
}

.modal-header {
    border-bottom: 1px solid var(--ap-border);
    border-radius: 1rem 1rem 0 0;
}

.modal-footer {
    border-top: 1px solid var(--ap-border);
    border-radius: 0 0 1rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-dark .navbar-brand {
    color: white;
}

.nav-pills .nav-link {
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.nav-pills .nav-link:hover {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--ap-primary);
}

.nav-pills .nav-link.active {
    background-color: var(--ap-primary);
    color: white;
}

.badge {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.alert {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--ap-shadow);
}

.alert-info {
    background-color: rgba(8, 145, 178, 0.1);
    color: var(--bs-info);
}

.spinner-border { width: 2rem; height: 2rem; }
.spinner-border-sm { width: 1rem; height: 1rem; }

.shadow-sm { box-shadow: var(--ap-shadow) !important; }
.shadow    { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06) !important; }
.shadow-lg { box-shadow: 0 10px 25px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05) !important; }

.bg-light      { background-color: var(--ap-background) !important; }
.text-primary  { color: var(--ap-primary) !important; }
.text-muted    { color: var(--ap-text-secondary) !important; }

.border        { border: 1px solid var(--ap-border) !important; }
.border-end    { border-right: 1px solid var(--ap-border) !important; }
.border-top    { border-top: 1px solid var(--ap-border) !important; }

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

.fade-in-up { animation: fadeInUp 0.5s ease-out; }

.bi { vertical-align: -0.125em; }

@media (max-width: 768px) {
    .card { margin-bottom: 1rem; }
    .btn-lg { padding: 0.5rem 1rem; font-size: 1rem; }
    .modal-dialog { margin: 0.5rem; }
}

/* Respect prefers-reduced-motion everywhere */
@media (prefers-reduced-motion: reduce) {
    .btn-primary:hover,
    .card:hover,
    .fade-in-up {
        transform: none !important;
        animation: none !important;
    }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--ap-background); }
::-webkit-scrollbar-thumb { background: var(--ap-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ap-text-secondary); }
