/* TaskBusters - Ghostbusters Inspired Theme */
/* Color Palette: Dark Navy (#1a1a2e), Ghost White (#f8f9fa), Proton Orange (#ff6b00), Slime Green (#00ff41), Ecto Red (#ff0000) */

:root {
    --tb-navy: #1a1a2e;
    --tb-navy-light: #252542;
    --tb-navy-lighter: #2d2d4a;
    --tb-ghost: #f8f9fa;
    --tb-proton: #ff6b00;
    --tb-proton-glow: #ff8c33;
    --tb-slime: #00ff41;
    --tb-slime-glow: #33ff6b;
    --tb-ecto: #ff0000;
    --tb-ecto-glow: #ff4444;
    --tb-gray: #6c757d;
    --tb-border: #3a3a5a;
    /* Bootstrap dark-theme overrides: light text on dark backgrounds */
    --bs-body-color: var(--tb-ghost);
    --bs-body-color-rgb: 248, 249, 250;
    --bs-emphasis-color: var(--tb-ghost);
    --bs-emphasis-color-rgb: 248, 249, 250;
    --bs-secondary-color: rgba(248, 249, 250, 0.75);
    --bs-secondary-color-rgb: 248, 249, 250;
    --bs-tertiary-color: rgba(248, 249, 250, 0.55);
    --bs-tertiary-color-rgb: 248, 249, 250;
    --bs-body-bg: var(--tb-navy);
    --bs-border-color: var(--tb-border);
}

/* text-muted is light on dark backgrounds, but must stay dark on light surfaces */
.bg-light .text-muted,
.bg-light.text-muted {
    color: var(--tb-gray) !important;
}

/* Base Styles */
html, body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--tb-navy);
    color: var(--tb-ghost);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--tb-proton);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--tb-proton-glow);
}

.btn {
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--tb-proton) 0%, var(--tb-ecto) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--tb-proton-glow) 0%, var(--tb-ecto-glow) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--tb-proton);
    color: var(--tb-proton);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--tb-proton);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.btn-outline-secondary {
    border: 2px solid var(--tb-gray);
    color: var(--tb-gray);
}

.btn-outline-secondary:hover {
    background: var(--tb-gray);
    color: white;
}

.btn-outline-danger {
    border: 2px solid var(--tb-ecto);
    color: var(--tb-ecto);
}

.btn-outline-danger:hover {
    background: var(--tb-ecto);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--tb-slime) 0%, #00cc33 100%);
    color: var(--tb-navy);
    box-shadow: 0 4px 15px rgba(0, 255, 65, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--tb-slime-glow) 0%, #00ff41 100%);
    color: var(--tb-navy);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 65, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    color: var(--tb-navy);
}

/* Navbar - Ghostbusters Style */
.tb-navbar {
    background: linear-gradient(180deg, var(--tb-navy) 0%, var(--tb-navy-light) 100%) !important;
    border-bottom: 3px solid var(--tb-proton);
    box-shadow: 0 4px 30px rgba(255, 107, 0, 0.2);
    position: relative;
}

.tb-navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--tb-ecto), var(--tb-proton), var(--tb-slime), var(--tb-proton), var(--tb-ecto));
    background-size: 200% 100%;
    animation: proton-stream 3s linear infinite;
}

@keyframes proton-stream {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.tb-logo {
    border-radius: 1rem;
    padding: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    filter: drop-shadow(0 0 6px rgba(255, 107, 0, 0.4));
}

@keyframes logo-pulse {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 107, 0, 0.6)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 107, 0, 0.8)) drop-shadow(0 0 30px rgba(0, 255, 65, 0.4)); }
}

.tb-brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--tb-ghost), var(--tb-proton), var(--tb-slime));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 107, 0, 0.5);
}

/* Nav Links */
.nav-link {
    color: rgba(248, 249, 250, 0.8) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem;
    margin: 0 0.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--tb-ghost) !important;
    background: rgba(255, 107, 0, 0.15);
}

.nav-link.active {
    color: var(--tb-proton) !important;
    background: rgba(255, 107, 0, 0.2);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, var(--tb-proton), var(--tb-slime));
    border-radius: 2px;
    animation: proton-beam 1s ease-out;
}

@keyframes proton-beam {
    from { width: 0; opacity: 0; }
    to { width: 30px; opacity: 1; }
}

/* Cards */
.card {
    background: var(--tb-navy-light);
    border: 1px solid var(--tb-border);
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 15px 50px rgba(255, 107, 0, 0.15);
    border-color: rgba(255, 107, 0, 0.3);
}

.card-header {
    background: var(--tb-navy) !important;
    border-bottom: 2px solid var(--tb-proton);
    border-radius: 1rem 1rem 0 0 !important;
    font-weight: 700;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table {
    color: var(--tb-ghost);
}

.table th {
    border-bottom: 2px solid var(--tb-proton);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--tb-proton);
}

.table td {
    border-color: var(--tb-border);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(255, 107, 0, 0.1);
}

.table-primary {
    background: rgba(255, 107, 0, 0.2) !important;
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 2rem;
}

.bg-primary { background: linear-gradient(135deg, var(--tb-proton), var(--tb-ecto)) !important; }
.bg-success { background: linear-gradient(135deg, var(--tb-slime), #00cc33) !important; }
.bg-warning { background: linear-gradient(135deg, #ffc107, #ff8f00) !important; }
.bg-danger { background: linear-gradient(135deg, var(--tb-ecto), #cc0000) !important; }
.bg-secondary { background: linear-gradient(135deg, var(--tb-gray), #5a6268) !important; }
.bg-info { background: linear-gradient(135deg, #0dcaf0, #0aa8cc) !important; }
.bg-dark { background: linear-gradient(135deg, var(--tb-navy), var(--tb-navy-light)) !important; }
.bg-light { background: var(--tb-ghost) !important; color: var(--tb-navy) !important; }

/* Forms */
.form-control, .form-select {
    background: var(--tb-navy);
    border: 2px solid var(--tb-border);
    color: var(--tb-ghost);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    background: var(--tb-navy);
    border-color: var(--tb-proton);
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 0, 0.25);
    color: var(--tb-ghost);
}

.form-control::placeholder {
    color: rgba(248, 249, 250, 0.4);
}

.form-label {
    font-weight: 600;
    color: var(--tb-ghost);
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--tb-gray);
    font-size: 0.8rem;
}

.form-check-label {
    color: var(--tb-ghost);
    opacity: 1;
}

/* Modals */
.modal-backdrop-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.modal-dialog {
    z-index: 1050;
}

.modal-card {
    background: var(--tb-navy-light);
    border: 1px solid var(--tb-border);
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    color: var(--tb-ghost);
}

.modal-card .modal-header,
.modal-card .modal-title,
.modal-card .modal-body,
.modal-card .modal-footer {
    color: var(--tb-ghost);
}

.modal-card.border-danger {
    border-color: var(--tb-ecto) !important;
    box-shadow: 0 20px 60px rgba(255, 0, 0, 0.3);
}

.modal-header {
    background: var(--tb-navy) !important;
    border-bottom: 2px solid var(--tb-border);
    border-radius: 1rem 1rem 0 0 !important;
}

.modal-header.bg-danger {
    background: linear-gradient(135deg, var(--tb-ecto), #cc0000) !important;
}

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

.modal-backdrop.show {
    opacity: 0.8;
    background: var(--tb-navy);
}

/* List Groups */
.list-group-item {
    background: transparent;
    border-color: var(--tb-border);
    color: var(--tb-ghost);
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background: rgba(255, 107, 0, 0.1);
}

.drag-handle:hover {
    color: var(--tb-proton) !important;
    cursor: grab;
}

.task-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--tb-proton) !important;
    border-radius: 0.5rem;
}

.sortable-chosen {
    box-shadow: 0 10px 30px rgba(255, 107, 0, 0.4);
    transform: rotate(2deg);
}

/* Stats Cards */
.stat-item {
    transition: all 0.3s ease;
    border-radius: 1rem;
    border: 1px solid var(--tb-border);
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(255, 107, 0, 0.2);
    border-color: var(--tb-proton);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Pagination */
.pagination .page-link {
    background: var(--tb-navy);
    border: 2px solid var(--tb-border);
    color: var(--tb-proton);
    font-weight: 600;
    margin: 0 0.25rem;
    border-radius: 0.5rem;
}

.pagination .page-link:hover {
    background: var(--tb-proton);
    border-color: var(--tb-proton);
    color: white;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--tb-proton), var(--tb-ecto));
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.4);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    color: var(--tb-gray);
}

/* Dropdown */
.dropdown-menu {
    background: var(--tb-navy-light);
    border: 1px solid var(--tb-border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 0.5rem;
}

.dropdown-item {
    color: var(--tb-ghost);
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255, 107, 0, 0.2);
    color: var(--tb-proton);
}

.dropdown-divider {
    border-color: var(--tb-border);
}

/* Footer */
footer {
    background: var(--tb-navy) !important;
    border-top: 2px solid var(--tb-proton) !important;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.75rem;
    border-left: 4px solid;
}

.alert-success { background: rgba(0, 255, 65, 0.15); border-left-color: var(--tb-slime); color: var(--tb-slime); }
.alert-danger { background: rgba(255, 0, 0, 0.15); border-left-color: var(--tb-ecto); color: var(--tb-ecto); }
.alert-warning { background: rgba(255, 193, 7, 0.15); border-left-color: #ffc107; color: #ffc107; }
.alert-info { background: rgba(13, 202, 240, 0.15); border-left-color: #0dcaf0; color: #0dcaf0; }
.alert-light { background: rgba(248, 249, 250, 0.1); border-left-color: var(--tb-gray); color: var(--tb-ghost); }

/* Spinners */
.spinner-border {
    border-width: 3px;
}

.spinner-border.text-primary {
    border-color: var(--tb-proton) transparent var(--tb-slime) transparent;
}

/* Badges for points */
.bg-light.text-dark {
    background: var(--tb-ghost) !important;
    color: var(--tb-navy) !important;
}

/* Animation for new entries */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-group-item {
    animation: slideInUp 0.3s ease-out;
}

/* Bootstrap Icons: inherit surrounding text color (light on dark, dark on light) */
.bi {
    fill: currentColor;
}

/* Empty states */
.text-muted svg {
    opacity: 0.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--tb-navy);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--tb-proton), var(--tb-slime));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--tb-proton-glow), var(--tb-slime-glow));
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--tb-proton);
    outline-offset: 2px;
}

/* Blazor Server error UI - hidden by default, fixed bottom bar */
#blazor-error-ui {
    background: linear-gradient(135deg, #1a1a2e 0%, #252542 100%);
    border-top: 2px solid var(--tb-proton);
    bottom: 0;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.4);
    display: none;
    left: 0;
    padding: 0.6rem 3.5rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .reload {
    color: var(--tb-proton);
    font-weight: 700;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tb-brand-text {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
}