/* ============================================================
   My Tickets - Custom Light & Dark Theme Palettes
   ============================================================ */

:root {
    /* User-Defined Light Mode Palette */
    --primary-100: #d4eaf7;
    --primary-200: #b6ccd8;
    --primary-300: #3b3c3d;
    --accent-100: #71c4ef;
    --accent-200: #00668c;
    --text-100: #1d1c1c;
    --text-200: #313d44;
    --bg-100: #fffefb;
    --bg-200: #f5f4f1;
    --bg-300: #cccbc8;

    /* Semantic Component Mappings */
    --bs-primary: var(--accent-200);
    --bs-primary-rgb: 0, 102, 140;
    --bs-secondary: var(--primary-300);
    --theme-bg-body: var(--bg-200);
    --theme-card-bg: var(--bg-100);
    --theme-border: var(--bg-300);
    --theme-text-main: var(--text-100);
    --theme-text-muted: var(--text-200);
    --theme-sidebar-bg: var(--primary-300);
    --theme-sidebar-text: var(--primary-200);
    --theme-sidebar-active: var(--accent-200);
    --theme-accent: var(--accent-100);
}

[data-bs-theme="dark"] {
    /* User-Defined Dark Mode Palette */
    --primary-100: #2C3A4F;
    --primary-200: #56647b;
    --primary-300: #b4c2dc;
    --accent-100: #FF4D4D;
    --accent-200: #ffecda;
    --text-100: #FFFFFF;
    --text-200: #e0e0e0;
    --bg-100: #1A1F2B;
    --bg-200: #292e3b;
    --bg-300: #414654;

    /* Semantic Component Mappings */
    --bs-primary: var(--primary-300);
    --bs-primary-rgb: 180, 194, 220;
    --bs-secondary: var(--primary-200);
    --theme-bg-body: var(--bg-100);
    --theme-card-bg: var(--bg-200);
    --theme-border: var(--bg-300);
    --theme-text-main: var(--text-100);
    --theme-text-muted: var(--text-200);
    --theme-sidebar-bg: var(--bg-200);
    --theme-sidebar-text: var(--primary-300);
    --theme-sidebar-active: var(--primary-100);
    --theme-accent: var(--accent-100);
}

/* Base Body Styles */
body {
    background-color: var(--theme-bg-body) !important;
    color: var(--theme-text-main) !important;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    background-color: var(--theme-sidebar-bg);
    min-height: 100vh;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.08);
}

.sidebar .nav-link {
    color: var(--theme-sidebar-text);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 0.15rem 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #ffffff;
    background-color: var(--theme-sidebar-active);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .sidebar .nav-link.active {
    color: var(--text-100);
    background-color: var(--primary-100);
    border: 1px solid var(--primary-300);
}

/* Navbar */
.navbar {
    background-color: var(--theme-card-bg) !important;
    border-color: var(--theme-border) !important;
}

/* Cards */
.card {
    background-color: var(--theme-card-bg);
    border: 1px solid var(--theme-border);
    border-radius: 0.75rem;
    color: var(--theme-text-main);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Text & Contrast Tweaks */
.text-muted {
    color: var(--theme-text-muted) !important;
}

/* Primary Buttons */
.btn-primary {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .btn-primary {
    background-color: var(--primary-200) !important;
    border-color: var(--primary-300) !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

/* Accent Badges & Highlights */
.badge.bg-primary {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .badge.bg-primary {
    background-color: var(--primary-100) !important;
    color: var(--primary-300) !important;
    border: 1px solid var(--primary-200);
}

/* Tables */
.table {
    color: var(--theme-text-main);
    border-color: var(--theme-border);
}

.table-light,
.table-light th,
.table-light td {
    background-color: var(--bg-200) !important;
    color: var(--theme-text-main) !important;
    border-color: var(--theme-border) !important;
}

[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] .table-light th,
[data-bs-theme="dark"] .table-light td {
    background-color: var(--bg-300) !important;
    color: var(--text-100) !important;
    border-color: var(--bg-200) !important;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(113, 196, 239, 0.08) !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(86, 100, 123, 0.25) !important;
}

/* Form Controls */
.form-control,
.form-select {
    background-color: var(--theme-card-bg);
    border-color: var(--theme-border);
    color: var(--theme-text-main);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--theme-card-bg);
    border-color: var(--accent-100);
    color: var(--theme-text-main);
    box-shadow: 0 0 0 0.25rem rgba(113, 196, 239, 0.25);
}

/* Stat Widgets */
.stat-widget {
    border-left: 4px solid var(--accent-200);
}
.stat-widget.widget-warning { border-left-color: #f59e0b; }
.stat-widget.widget-danger { border-left-color: var(--accent-100); }
.stat-widget.widget-success { border-left-color: #10b981; }
.stat-widget.widget-info { border-left-color: var(--accent-100); }
.stat-widget.widget-purple { border-left-color: #8b5cf6; }

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--theme-border);
}
.timeline-item {
    position: relative;
    margin-bottom: 1.25rem;
}
.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-200);
    border: 2px solid var(--theme-card-bg);
}

[data-bs-theme="dark"] .timeline-dot {
    background: var(--accent-100);
}

/* Comments */
.comment-box {
    border-left: 3px solid var(--accent-200);
}
.comment-box.internal {
    border-left-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.05);
}
.comment-box.technician {
    border-left-color: #10b981;
    background-color: rgba(16, 185, 129, 0.05);
}

/* Star rating */
.star-rating .bi-star-fill {
    color: #f59e0b;
}

/* Footer */
footer.bg-body {
    background-color: var(--theme-card-bg) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-muted) !important;
}
