/*
    ChurchScheduler Design System - 2026
    Theme: Clean Productivity
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors - Indigo/Violet Spectrum */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1; /* Main Brand */
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* Success Colors (Emerald) */
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-200: #a7f3d0;
    --success-300: #6ee7b7;
    --success-400: #34d399;
    --success-500: #10b981;
    --success-600: #059669;
    --success-700: #047857;
    --success-800: #065f46;
    --success-900: #064e3b;

    /* Warning Colors (Amber) */
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-200: #fde68a;
    --warning-300: #fcd34d;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;
    --warning-800: #92400e;
    --warning-900: #78350f;

    /* Danger Colors (Red) */
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-200: #fecaca;
    --danger-300: #fca5a5;
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;
    --danger-800: #991b1b;
    --danger-900: #7f1d1d;

    /* Neutrals (Slate) */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Semantic Colors */
    --bg-app: var(--slate-50);
    --bg-surface: #ffffff;
    --bg-surface-subtle: var(--slate-50);
    --bg-header: var(--slate-100);
    --text-main: var(--slate-900);
    --text-muted: var(--slate-500);
    --border-subtle: var(--slate-200);
    --border-focus: var(--primary-300);

    /* Components */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Header */
    --header-height: 4rem;
}

[data-bs-theme="dark"] {
    --bg-app: var(--slate-900);
    --bg-surface: var(--slate-800);
    --bg-surface-subtle: var(--slate-900);
    --bg-header: var(--slate-700);
    --text-main: var(--slate-100);
    --text-muted: var(--slate-400);
    --border-subtle: var(--slate-600);
    --border-focus: var(--primary-700);
}

/* Global Reset & Typography */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-height); /* Space for fixed header */
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

h1 {
    font-size: 1.875rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-700);
}

/* Layout Containers */
.container-fluid {
    padding: 1.5rem;
    width: 96%; /* Small gap on sides */
    max-width: 1920px; /* Cap width on ultra-wide screens */
    margin: 0 auto;
}

/* Card Pattern (The "Surface") */
#parent-div, .card-surface {
    /* Removed background and border as requested */
    border-radius: var(--radius-lg);
    /* box-shadow: var(--shadow-sm); Removed shadow too for cleaner look */
    padding: 2rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

/* Utility Classes for Backgrounds */
.bg-surface {
    background-color: var(--bg-surface) !important;
}

.bg-surface-subtle {
    background-color: var(--bg-surface-subtle) !important;
}

.bg-subtle {
    background-color: var(--bg-surface-subtle) !important;
}

.bg-header {
    background-color: var(--bg-header) !important;
}

/* Color Utilities - Generated from Variables */
/* Primary */
.text-primary-50 {
    color: var(--primary-50) !important;
}

.text-primary-100 {
    color: var(--primary-100) !important;
}

.text-primary-200 {
    color: var(--primary-200) !important;
}

.text-primary-300 {
    color: var(--primary-300) !important;
}

.text-primary-400 {
    color: var(--primary-400) !important;
}

.text-primary-500 {
    color: var(--primary-500) !important;
}

.text-primary-600 {
    color: var(--primary-600) !important;
}

.text-primary-700 {
    color: var(--primary-700) !important;
}

.text-primary-800 {
    color: var(--primary-800) !important;
}

.text-primary-900 {
    color: var(--primary-900) !important;
}

.bg-primary-50 {
    background-color: var(--primary-50) !important;
}

[data-bs-theme="dark"] .bg-primary-50 {
    background-color: rgba(79, 70, 229, 0.15) !important; /* Dark mode override for visibility */
}

.bg-primary-100 {
    background-color: var(--primary-100) !important;
}

.bg-primary-200 {
    background-color: var(--primary-200) !important;
}

.bg-primary-300 {
    background-color: var(--primary-300) !important;
}

.bg-primary-400 {
    background-color: var(--primary-400) !important;
}

.bg-primary-500 {
    background-color: var(--primary-500) !important;
}

.bg-primary-600 {
    background-color: var(--primary-600) !important;
}

.bg-primary-700 {
    background-color: var(--primary-700) !important;
}

.bg-primary-800 {
    background-color: var(--primary-800) !important;
}

.bg-primary-900 {
    background-color: var(--primary-900) !important;
}

.border-primary-200 {
    border-color: var(--primary-200) !important;
}

/* Success */
.text-success-50 {
    color: var(--success-50) !important;
}

.text-success-700 {
    color: var(--success-700) !important;
}

.bg-success-50 {
    background-color: var(--success-50) !important;
}

.border-success-200 {
    border-color: var(--success-200) !important;
}

/* Warning */
.text-warning-50 {
    color: var(--warning-50) !important;
}

.text-warning-700 {
    color: var(--warning-700) !important;
}

.bg-warning-50 {
    background-color: var(--warning-50) !important;
}

.border-warning-200 {
    border-color: var(--warning-200) !important;
}

/* Danger */
.text-danger-50 {
    color: var(--danger-50) !important;
}

.text-danger-700 {
    color: var(--danger-700) !important;
}

.bg-danger-50 {
    background-color: var(--danger-50) !important;
}

.border-danger-200 {
    border-color: var(--danger-200) !important;
}


/* Status Borders */
.border-start-status {
    border-left-width: 4px !important;
}

.border-status-success {
    border-left-color: var(--success-500) !important;
}

.border-status-warning {
    border-left-color: var(--warning-500) !important;
}

.border-status-danger {
    border-left-color: var(--danger-500) !important;
}

/* Navigation */
.navbar {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    height: var(--header-height);
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
}

[data-bs-theme="dark"] .navbar {
    background-color: rgba(15, 23, 42, 0.8) !important;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-600) !important;
    font-size: 1.25rem;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-600) !important;
    background-color: var(--primary-50);
}

[data-bs-theme="dark"] .nav-link:hover {
    background-color: var(--slate-700);
    color: var(--primary-300) !important;
}

/* Forms & Inputs */
.form-control, .form-select {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    font-size: 0.925rem;
    color: var(--text-main);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
    outline: 0;
    color: var(--text-main) !important;
    background-color: var(--bg-surface);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--primary-600);
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.925rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--primary-700);
    border-color: var(--primary-700);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--slate-200);
    border-color: var(--slate-400);
    color: var(--text-main);
}

[data-bs-theme="dark"] .btn-secondary:hover {
    background-color: var(--slate-700);
    border-color: var(--slate-500);
    color: var(--text-main);
}

/* Tables */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    --bs-table-border-color: var(--border-subtle);
    font-size: 0.925rem;
}

.table thead th {
    background-color: var(--bg-header);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Select2 Overrides */
.select2-container--bootstrap-5 .select2-selection {
    border-color: var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    min-height: 42px;
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
}

.select2-container--bootstrap-5 .select2-selection__rendered {
    color: var(--text-main) !important;
}

.select2-container--bootstrap-5 .select2-selection__placeholder {
    color: var(--text-muted) !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    color: var(--primary-700);
    border-radius: 4px;
    font-size: 0.85rem;
}

.select2-container--bootstrap-5 .select2-dropdown {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-main) !important;
}

.select2-container--bootstrap-5 .select2-results__option {
    color: var(--text-main) !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--primary-600) !important;
    color: white !important;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    background: var(--slate-700);
    border: 1px solid var(--slate-600);
    color: var(--slate-200);
}

/* Utilities */
.vertical-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    vertical-align: middle;
    display: table-cell;
    white-space: nowrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: var(--slate-100);
    color: var(--slate-700);
    font-size: 0.875rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-subtle);
}

.chip .btn-close {
    font-size: 0.6rem;
    margin-left: 0.5rem;
    opacity: 0.5;
}

/* Monochrome Badge */
.badge-mono {
    background-color: var(--slate-100);
    color: var(--slate-900);
    border: 1px solid var(--slate-300);
}

[data-bs-theme="dark"] .badge-mono {
    background-color: var(--slate-800);
    color: var(--slate-100);
    border-color: var(--slate-600);
}

/* HTMX Loading Indicator */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Config Columns Drag & Drop */
#config_columns .list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--slate-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

#config_columns .list li {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

/* Calendar Specifics */
#calendar_page_content .calendar td {
    height: 120px;
    border-color: var(--border-subtle);
}

#calendar_page_content .event {
    background-color: var(--primary-50);
    color: var(--primary-700);
    border: 1px solid var(--primary-200);
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
}

/* Login Page Specifics */
.form-signin {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 3rem !important;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* Terminal Logs */
.terminal-logs {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.log-line {
    padding: 2px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.log-time {
    color: var(--text-muted);
    font-size: 0.85em;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Custom Tabs */
.nav-tabs-custom {
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
}

.nav-tabs-custom .nav-link {
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 1rem 1.5rem;
    background: transparent;
    transition: all 0.2s;
}

.nav-tabs-custom .nav-link:hover:not(.active) {
    color: var(--text-main);
    border-bottom-color: var(--border-subtle);
}

.nav-tabs-custom .nav-link.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-600);
    background: transparent;
}

/* Sticky Action Bar */
.sticky-action-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 100;
    /* Removed background and border as requested */
    padding: 1rem;
    margin-top: 1rem;
    backdrop-filter: blur(8px); /* Added blur for floating effect */
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
}