/* ===========================
   PBC Analyzer Pro Custom Styles
   Save this as: assets/custom.css
   =========================== */

/* Root variables for consistent theming */
:root {
    --primary-blue: #1c7ed6;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e9ecef;
    --hover-bg: #f1f3f5;
    --active-bg: #e7f5ff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --success-green: #51cf66;
    --danger-red: #ff6b6b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

/* Sidebar styling */
.sidebar-pro {
    background: var(--sidebar-bg) !important;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: var(--shadow-md);
}

/* App header in sidebar */
.app-header {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--sidebar-border);
    margin-bottom: 1.5rem;
}

.app-header h4 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.app-header small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Accordion improvements */
.accordion {
    border: none !important;
}

.accordion-button {
    font-weight: 600 !important;
    font-size: 1rem !important;
    padding: 0.875rem 1rem !important;
    background-color: transparent !important;
    border: 1px solid var(--sidebar-border) !important;
    border-radius: 8px !important;
    margin-bottom: 0.5rem !important;
    transition: all 0.2s ease !important;
}

.accordion-button:not(.collapsed) {
    background-color: var(--active-bg) !important;
    border-color: var(--primary-blue) !important;
    color: var(--primary-blue) !important;
    box-shadow: none !important;
}

.accordion-button:hover {
    background-color: var(--hover-bg) !important;
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(28, 126, 214, 0.1) !important;
}

.accordion-body {
    padding: 1rem !important;
    background: transparent !important;
}

.accordion-item {
    border: none !important;
    background: transparent !important;
}

/* Button improvements */
.btn {
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    padding: 0.625rem 1rem !important;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #1c7ed6 0%, #1971c2 100%) !important;
    border: none !important;
}

.btn-light {
    background-color: var(--hover-bg) !important;
    border: 1px solid var(--sidebar-border) !important;
    color: var(--text-primary) !important;
}

.btn-light:hover {
    background-color: var(--sidebar-border) !important;
}

.btn-outline-danger {
    border-color: var(--danger-red) !important;
    color: var(--danger-red) !important;
}

.btn-outline-danger:hover {
    background-color: var(--danger-red) !important;
    color: white !important;
}

.btn-outline-success {
    border-color: var(--success-green) !important;
    color: var(--success-green) !important;
}

.btn-outline-success:hover {
    background-color: var(--success-green) !important;
    color: white !important;
}

/* Dropdown menu improvements */
.dropdown-menu {
    border-radius: 8px !important;
    border: 1px solid var(--sidebar-border) !important;
    box-shadow: var(--shadow-md) !important;
    padding: 0.5rem !important;
}

.dropdown-item {
    border-radius: 6px !important;
    margin-bottom: 2px !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.15s ease !important;
}

.dropdown-item:hover {
    background-color: var(--hover-bg) !important;
}

.dropdown-item.active {
    background-color: var(--primary-blue) !important;
}

.dropdown-toggle {
    border-radius: 8px !important;
    border: 1px solid var(--sidebar-border) !important;
    background-color: white !important;
    color: var(--text-primary) !important;
}

.dropdown-toggle:hover {
    background-color: var(--hover-bg) !important;
}

/* Switch/Toggle improvements */
.form-check {
    padding-left: 2.5rem !important;
    margin-bottom: 0.75rem !important;
}

.form-check-input {
    width: 2.5rem !important;
    height: 1.25rem !important;
    margin-top: 0.125rem !important;
    border-radius: 2rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.form-check-input:checked {
    background-color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
}

.form-check-label {
    font-size: 0.9375rem !important;
    color: var(--text-primary) !important;
    font-weight: 500 !important;
    cursor: pointer !important;
}

/* Baseline mode active state - HIGHLIGHT THE CHART */
.baseline-mode-active {
    border: 3px solid var(--primary-blue) !important;
    box-shadow: 0 0 0 4px rgba(28, 126, 214, 0.15) !important;
    border-radius: 8px !important;
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(28, 126, 214, 0.15);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(28, 126, 214, 0.25);
    }
}

/* Alert improvements */
.alert {
    border-radius: 8px !important;
    border: none !important;
    padding: 0.875rem 1rem !important;
    font-weight: 500 !important;
}

.alert-success {
    background-color: #d3f9d8 !important;
    color: #2b8a3e !important;
}

.alert-danger {
    background-color: #ffe3e3 !important;
    color: #c92a2a !important;
}

/* Form labels */
.form-label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--text-secondary) !important;
    margin-bottom: 0.5rem !important;
}

/* Dividers */
hr {
    opacity: 0.1 !important;
    margin: 1rem 0 !important;
}

/* Chart container */
#pbc-chart {
    transition: all 0.3s ease !important;
}

/* Scrollbar styling for sidebar */
.sidebar-pro::-webkit-scrollbar {
    width: 8px;
}

.sidebar-pro::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-pro::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 4px;
}

.sidebar-pro::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Smooth transitions */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Focus states for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-blue) !important;
    outline-offset: 2px !important;
}

/* Disabled state improvements */
.btn:disabled,
.form-check-input:disabled,
.dropdown-toggle:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* ===========================
   PBC Analyzer Pro - Mantine Custom Styles
   Save this as: assets/custom.css
   =========================== */

/* Baseline mode active state - highlight the chart */
.baseline-mode-active {
    border: 3px solid #1c7ed6 !important;
    box-shadow: 0 0 0 4px rgba(28, 126, 214, 0.15) !important;
    border-radius: 8px !important;
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(28, 126, 214, 0.15);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(28, 126, 214, 0.25);
    }
}

/* Make dropdowns full width in sidebar */
.dropdown-menu {
    width: 100%;
}

/* Improve dropdown toggle styling */
.dropdown-toggle {
    width: 100%;
    text-align: left;
}

/* Ensure proper spacing in Mantine components */
.mantine-AppShell-navbar {
    overflow-y: auto !important;
}

/* Custom scrollbar for sidebar */
.mantine-AppShell-navbar::-webkit-scrollbar {
    width: 8px;
}

.mantine-AppShell-navbar::-webkit-scrollbar-track {
    background: transparent;
}

.mantine-AppShell-navbar::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
}

.mantine-AppShell-navbar::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Prevent Mantine buttons from wrapping */
.mantine-Button-root {
    white-space: nowrap !important;
}

.mantine-Button-inner {
    white-space: nowrap !important;
}

.mantine-Button-label {
    white-space: nowrap !important;
}

.mantine-Button-root .mantine-Group-root {
    flex-wrap: nowrap !important;
}

.mantine-Button-root .mantine-Text-root {
    white-space: nowrap !important;
}

/* 1. Target the NavLink Root for Hover */
.column-nav-item:hover {
    background-color: #e7f5ff !important; /* Soft Blue */
    color: #1c7ed6 !important;            /* Primary Blue Text */
}

/* 2. Target the 'Active/Selected' state */
/* target both custom class and Mantine's internal data attribute */
.column-nav-item.selected, 
.column-nav-item[data-active="true"] {
    background-color: #d0ebff !important; /* Stronger Blue */
    border-left: 4px solid #1c7ed6 !important;
    font-weight: 600 !important;
}

/* 3. Ensure the Description (Date) text doesn't disappear */
.column-nav-item:hover .mantine-NavLink-description,
.column-nav-item.selected .mantine-NavLink-description {
    color: #1971c2 !important;
    opacity: 0.8;
}

/* 4. Smooth out the transition */
.column-nav-item {
    transition: all 0.15s ease-in-out !important;
    border-left: 4px solid transparent;
}

#help-modal-content th,
#help-modal-content td {
    padding-left: 1rem;
    padding-right: 1rem;
}
