/* Dark theme (default) */
:root,
[data-theme="dark"] {
    /* Modern color palette with gradients */
    --jam-primary: #667eea;
    --jam-primary-dark: #5568d3;
    --jam-secondary: #764ba2;
    --jam-accent: #f093fb;
    --jam-success: #4ade80;
    --jam-warning: #fbbf24;
    --jam-danger: #f87171;
    --jam-info: #60a5fa;

    /* Background and surfaces */
    --jam-background: #0f0f23;
    --jam-background-secondary: #1a1a2e;
    --jam-surface: rgba(30, 30, 46, 0.6);
    --jam-surface-hover: rgba(40, 40, 60, 0.8);

    /* Text colors */
    --jam-text-color: #e5e7eb;
    --jam-text-muted: #9ca3af;
    --jam-text-dim: #9ca3af;

    /* Border and shadow */
    --jam-border-color: rgba(99, 102, 241, 0.1);
    --jam-border-hover: rgba(99, 102, 241, 0.3);

    /* Gradients */
    --jam-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --jam-gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --jam-gradient-success: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    --jam-gradient-warning: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --jam-gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    --jam-gradient-info: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);

    /* Shadows */
    --jam-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --jam-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --jam-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --jam-shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);

    --jam-sidebar-width: 250px;
}

/* Light theme */
[data-theme="light"],
[data-bs-theme="light"] {
    /* Modern color palette with gradients */
    --jam-primary: #5568d3;
    --jam-primary-dark: #4556c4;
    --jam-secondary: #764ba2;
    --jam-accent: #d946ef;
    --jam-success: #22c55e;
    --jam-warning: #f59e0b;
    --jam-danger: #ef4444;
    --jam-info: #3b82f6;

    /* Background and surfaces */
    --jam-background: #ffffff;
    --jam-background-secondary: #f8f9fa;
    --jam-surface: rgba(255, 255, 255, 0.95);
    --jam-surface-hover: rgba(248, 249, 250, 1);

    /* Text colors */
    --jam-text-color: #1f2937;
    --jam-text-muted: #6b7280;
    --jam-text-dim: #9ca3af;

    /* Border and shadow */
    --jam-border-color: rgba(0, 0, 0, 0.08);
    --jam-border-hover: rgba(99, 102, 241, 0.3);

    /* Gradients */
    --jam-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --jam-gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --jam-gradient-success: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    --jam-gradient-warning: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --jam-gradient-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    --jam-gradient-info: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);

    /* Shadows */
    --jam-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --jam-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --jam-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --jam-shadow-glow: 0 0 20px rgba(102, 126, 234, 0.15);

    --jam-sidebar-width: 250px;
}

/* Card styling with glass-morphism */
.card {
    background: var(--jam-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--jam-border-color);
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--jam-shadow-sm);
}

.card:hover {
    border-color: var(--jam-border-hover);
    box-shadow: var(--jam-shadow-md);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 1px solid var(--jam-border-color);
}

.card-footer {
    border-top: 1px solid var(--jam-border-color);
}

.card-title {
    font-weight: 600;
    letter-spacing: -0.3px;
}

/* Tables */
.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--jam-border-color);
    color: var(--jam-text-color);
}

.table thead {
    background: rgba(99, 102, 241, 0.05);
    border-bottom: 2px solid var(--jam-border-hover);
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--jam-text-muted);
    padding: 1rem 0.75rem;
}

.table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-color: var(--jam-border-color);
}

.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: scale(1.01);
}

.table a {
    color: var(--jam-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.table a:hover {
    color: var(--jam-accent);
}

/* List groups */
.list-group-item {
    background: transparent;
    border-color: var(--jam-border-color);
    color: var(--jam-text-color);
    transition: all 0.2s ease;
    padding: 1rem 0;
}

.list-group-item:hover {
    background: rgba(99, 102, 241, 0.05);
}

.list-group-item a {
    color: var(--jam-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.list-group-item a:hover {
    color: var(--jam-accent);
}

/* Badges */
.badge {
    padding: 0.4em 0.75em;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

/* Badge subtle variants — dark theme */
[data-theme="dark"] .badge.text-bg-secondary-subtle,
[data-bs-theme="dark"] .badge.text-bg-secondary-subtle {
    background: rgba(107, 114, 128, 0.2) !important;
    color: #d1d5db !important;
    border-color: rgba(107, 114, 128, 0.3) !important;
}
[data-theme="dark"] .badge.text-bg-primary-subtle,
[data-bs-theme="dark"] .badge.text-bg-primary-subtle {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #a5b4fc !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}
[data-theme="dark"] .badge.text-bg-info-subtle,
[data-bs-theme="dark"] .badge.text-bg-info-subtle {
    background: rgba(96, 165, 250, 0.2) !important;
    color: #93c5fd !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
}
[data-theme="dark"] .badge.text-bg-success-subtle,
[data-bs-theme="dark"] .badge.text-bg-success-subtle {
    background: rgba(74, 222, 128, 0.2) !important;
    color: #86efac !important;
    border-color: rgba(74, 222, 128, 0.3) !important;
}
[data-theme="dark"] .badge.text-bg-warning-subtle,
[data-bs-theme="dark"] .badge.text-bg-warning-subtle {
    background: rgba(251, 191, 36, 0.2) !important;
    color: #fde68a !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}
[data-theme="dark"] .badge.text-bg-danger-subtle,
[data-bs-theme="dark"] .badge.text-bg-danger-subtle {
    background: rgba(248, 113, 113, 0.2) !important;
    color: #fca5a5 !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
}

/* Badge subtle variants — light theme */
[data-theme="light"] .badge.text-bg-secondary-subtle,
[data-bs-theme="light"] .badge.text-bg-secondary-subtle {
    background: rgba(107, 114, 128, 0.12) !important;
    color: #4b5563 !important;
    border-color: rgba(107, 114, 128, 0.25) !important;
}
[data-theme="light"] .badge.text-bg-primary-subtle,
[data-bs-theme="light"] .badge.text-bg-primary-subtle {
    background: rgba(85, 104, 211, 0.12) !important;
    color: #4338ca !important;
    border-color: rgba(85, 104, 211, 0.25) !important;
}
[data-theme="light"] .badge.text-bg-info-subtle,
[data-bs-theme="light"] .badge.text-bg-info-subtle {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #1d4ed8 !important;
    border-color: rgba(59, 130, 246, 0.25) !important;
}
[data-theme="light"] .badge.text-bg-success-subtle,
[data-bs-theme="light"] .badge.text-bg-success-subtle {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #15803d !important;
    border-color: rgba(34, 197, 94, 0.25) !important;
}
[data-theme="light"] .badge.text-bg-warning-subtle,
[data-bs-theme="light"] .badge.text-bg-warning-subtle {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #92400e !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}
[data-theme="light"] .badge.text-bg-danger-subtle,
[data-bs-theme="light"] .badge.text-bg-danger-subtle {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #b91c1c !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-primary {
    background: var(--jam-gradient-primary);
    color: white;
    box-shadow: var(--jam-shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--jam-shadow-glow);
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

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

.btn-outline-primary:hover {
    background: var(--jam-gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: var(--jam-shadow-glow);
}

.btn-outline-secondary {
    border: 2px solid var(--jam-text-muted);
    color: var(--jam-text-muted);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--jam-surface-hover);
    border-color: var(--jam-text-color);
    color: var(--jam-text-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--jam-text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
    background: var(--jam-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.25rem;
    font-weight: 500;
}

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

.card {
    animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.2s;
}

.card:nth-child(4) {
    animation-delay: 0.3s;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--jam-surface-hover);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--jam-primary);
}

/* Loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Focus states for accessibility */
a:focus,
button:focus,
.nav-link:focus,
input:focus,
select:focus,
textarea:focus,
.dropdown-toggle:focus {
    outline: 2px solid var(--jam-primary);
    outline-offset: 2px;
}

/* Text utilities */
.text-body-secondary {
    color: var(--jam-text-muted) !important;
}

.text-muted {
    color: var(--jam-text-dim) !important;
}

/* Link styling */
a {
    color: var(--jam-primary);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--jam-accent);
}

/* ============================================================================
   Password Strength Meter
   ============================================================================ */

/* Password strength progress bar colors */
.password-strength-weak {
    background-color: #ef4444;
    background-image: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.password-strength-fair {
    background-color: #f59e0b;
    background-image: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.password-strength-good {
    background-color: #3b82f6;
    background-image: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.password-strength-strong {
    background-color: #22c55e;
    background-image: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

/* Password strength label colors */
.password-strength-label {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.password-strength-label.password-strength-weak {
    color: #ef4444;
}

.password-strength-label.password-strength-fair {
    color: #f59e0b;
}

.password-strength-label.password-strength-good {
    color: #3b82f6;
}

.password-strength-label.password-strength-strong {
    color: #22c55e;
}

/* Password requirements checklist */
#password-requirements {
    padding: 0.75rem;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    border: 1px solid var(--jam-border-color);
}

[data-theme="dark"] #password-requirements,
[data-bs-theme="dark"] #password-requirements {
    background-color: rgba(255, 255, 255, 0.02);
}

#password-requirements > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.req-icon {
    font-size: 0.875rem;
    flex-shrink: 0;
}

.req-text {
    line-height: 1.4;
}

/* Smooth progress bar transition */
#password-strength-bar {
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Progress bar styling */
.progress {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

[data-theme="dark"] .progress,
[data-bs-theme="dark"] .progress {
    background-color: rgba(255, 255, 255, 0.05);
}
