/* Lighthouse Genetics Dashboard — Brand CSS */
/* Colors: #CF0303 (red), #7F0707 (dark maroon), #000 (black), #FFF (white) */
/* #CF0303 fails on dark bg — use #FF6666 for text on dark */

:root {
    --lh-red: #CF0303;
    --lh-maroon: #7F0707;
    --lh-red-light: #FF6666;
}

body {
    font-family: 'Raleway', sans-serif;
    background-color: #0A0A0A;
    color: #E0E0E0;
}

.brand-text {
    font-family: 'Chewy', cursive;
    color: var(--lh-red-light) !important;
    font-size: 1.4rem;
}

/* Navbar */
.navbar {
    background-color: #000 !important;
}

.nav-link.active {
    color: var(--lh-red-light) !important;
    font-weight: 600;
}

.nav-link:hover {
    color: var(--lh-red-light) !important;
}

/* Cards */
.card {
    border-radius: 8px;
}

.stat-card {
    border-left: 4px solid var(--lh-red) !important;
    background-color: #1A1A1A !important;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: #FFF;
}

.stat-card .stat-label {
    color: #999;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Buttons */
.btn-danger {
    background-color: var(--lh-red);
    border-color: var(--lh-red);
}

.btn-danger:hover {
    background-color: var(--lh-maroon);
    border-color: var(--lh-maroon);
}

.btn-outline-danger {
    color: var(--lh-red-light);
    border-color: var(--lh-red);
}

.btn-outline-danger:hover {
    background-color: var(--lh-red);
    border-color: var(--lh-red);
    color: #FFF;
}

/* Tables */
.table {
    --bs-table-bg: transparent;
}

.table > thead {
    border-bottom: 2px solid var(--lh-maroon);
}

.table > tbody > tr:hover {
    background-color: rgba(207, 3, 3, 0.05);
}

/* Order status badges */
.badge-processing { background-color: #0d6efd; }
.badge-on-hold { background-color: #ffc107; color: #000; }
.badge-completed { background-color: #198754; }
.badge-shipped { background-color: #6f42c1; }
.badge-pending { background-color: #6c757d; }
.badge-cancelled { background-color: #dc3545; }
.badge-refunded { background-color: #fd7e14; }
.badge-failed { background-color: #dc3545; }

/* Login card */
.card.border-danger {
    border-color: var(--lh-maroon) !important;
}

/* Form controls in dark mode */
.form-control:focus {
    border-color: var(--lh-red);
    box-shadow: 0 0 0 0.2rem rgba(207, 3, 3, 0.25);
}

/* Pagination */
.page-link {
    background-color: #1A1A1A;
    border-color: #333;
    color: #E0E0E0;
}

.page-item.active .page-link {
    background-color: var(--lh-red);
    border-color: var(--lh-red);
}

/* ============================================
   INSTRUMENT CLUSTER — Chevy Tahoe RST Style
   ============================================ */

/* Panel container — darker, less border */
.instrument-panel {
    background: linear-gradient(180deg, #0D0D0D 0%, #080808 100%);
    border: 1px solid #222;
    border-radius: 16px;
    padding: 1.5rem 1rem;
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.7),
        0 4px 24px rgba(0, 0, 0, 0.8);
}

.panel-label {
    font-family: 'Chewy', cursive;
    color: var(--lh-red-light);
    font-size: 1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.5;
}

/* Tahoe gauge cluster — horizontal flex layout */
.gauge-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: nowrap;
}

.gauge-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.gauge-large {
    z-index: 2;
}

.gauge-small {
    z-index: 1;
    margin-top: 20px;
}

/* Canvas gauge containers */
canvas[data-type] {
    max-width: 100%;
    height: auto !important;
}

.gauge-sub {
    color: #555;
    font-size: 0.7rem;
    margin-top: -6px;
    text-align: center;
}

/* ---- LCD Center Panel (Tahoe info screen) ---- */
.lcd-center {
    background: linear-gradient(180deg, #0A0E14 0%, #060A10 100%);
    border: 1px solid #2A3040;
    border-radius: 10px;
    padding: 14px 18px;
    min-width: 220px;
    max-width: 260px;
    flex-shrink: 1;
    z-index: 3;
    box-shadow:
        inset 0 0 20px rgba(10, 20, 40, 0.5),
        0 0 8px rgba(0, 0, 0, 0.6);
}

.lcd-header {
    text-align: center;
    color: #556;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
    opacity: 0.6;
}

.lcd-section {
    margin-bottom: 4px;
}

.lcd-section-label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #778;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.lcd-divider {
    border-top: 1px solid #1A2030;
    margin: 8px 0;
}

/* LCD Hot Sellers */
.lcd-hot-sellers {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lcd-hot-sellers li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: #AAB;
    padding: 1px 0;
}

.lcd-hot-sellers li.no-data {
    color: #556;
    justify-content: center;
    font-style: italic;
}

.lcd-hot-sellers .seller-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.65rem;
}

.lcd-hot-sellers .seller-count {
    color: var(--lh-red-light);
    font-weight: 600;
    font-size: 0.72rem;
    font-family: 'Courier New', 'Consolas', monospace;
    flex-shrink: 0;
    margin-left: 8px;
}

/* LCD Odometer */
.lcd-odometer {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--lh-red-light);
    letter-spacing: 2px;
    text-align: center;
    text-shadow: 0 0 10px rgba(207, 3, 3, 0.3);
}

/* LCD Month Comparison */
.lcd-comparison {
    display: flex;
    justify-content: space-around;
}

.lcd-comp-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.lcd-comp-label {
    color: #556;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.lcd-comp-value {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.85rem;
    font-weight: 700;
}

.lcd-up {
    color: #4CAF50;
}

.lcd-down {
    color: var(--lh-red-light);
}

/* Status chips */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1A1A1A;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 4px 10px 4px 6px;
}

.status-chip-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #FFF;
}

/* Responsive — tablet: hide small gauges, stack on mobile */
@media (max-width: 1200px) {
    .gauge-cluster {
        gap: 0;
    }
    .gauge-small canvas[data-type] {
        max-width: 140px;
    }
    .lcd-center {
        min-width: 180px;
        padding: 10px 14px;
    }
}

@media (max-width: 992px) {
    .gauge-small {
        display: none;
    }
    .gauge-cluster {
        gap: 0;
    }

    /* Stack analytics + inbox vertically on tablet */
    .aux-gauges-shelf {
        flex-direction: column !important;
    }
    .aux-gauges-shelf .ms-auto {
        margin-left: 0 !important;
    }
}

@media (max-width: 768px) {
    .stat-card .stat-number {
        font-size: 1.5rem;
    }

    .instrument-panel {
        padding: 1rem 0.5rem;
    }

    .gauge-cluster {
        flex-direction: column;
        gap: 12px;
    }

    .gauge-small {
        display: flex;
        margin-top: 0;
    }

    .gauge-small canvas[data-type] {
        max-width: 140px;
    }

    .lcd-center {
        min-width: unset;
        max-width: 100%;
        width: 100%;
        order: -1;
    }

    .lcd-odometer {
        font-size: 1.2rem;
    }

    .panel-label {
        font-size: 0.9rem;
    }

    /* Analytics gauges: 2x2 grid on mobile */
    .aux-gauge-row {
        flex-wrap: wrap !important;
        justify-content: center;
    }
    .aux-gauge-row canvas[data-type] {
        max-width: 110px;
    }

    /* Mini inbox full width on mobile */
    .mini-inbox-wrap {
        min-width: unset !important;
        max-width: 100% !important;
        width: 100%;
    }

    /* Stack subscriber + inbox vertically */
    .aux-right-group {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
    }

    /* Order table: stack action buttons, smaller text */
    .table-responsive {
        font-size: 0.8rem;
    }
    .table .btn-sm {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    .table .text-nowrap {
        white-space: normal !important;
    }
    .table td .btn {
        margin-bottom: 4px;
    }

    /* Status chips wrap nicely */
    .status-chip {
        font-size: 0.75rem;
        padding: 3px 8px 3px 4px;
    }
}

@media (max-width: 480px) {
    .stat-card .stat-number {
        font-size: 1.2rem;
    }
    .stat-card .stat-label {
        font-size: 0.72rem;
    }

    /* Hide less critical columns on very small screens */
    .table .col-hide-xs {
        display: none;
    }

    .gauge-cluster .gauge-large canvas[data-type] {
        max-width: 200px;
    }

    .lcd-center {
        padding: 10px 12px;
    }

    .lcd-hot-sellers .seller-name {
        max-width: 100px;
    }
}

/* ---- Mini Inbox ---- */
.inbox-list {
    max-height: 320px;
    overflow-y: auto;
}

.inbox-item {
    padding: 6px 12px;
    border-bottom: 1px solid #222;
    cursor: default;
    transition: background-color 0.15s;
}

.inbox-item:hover {
    background-color: rgba(207, 3, 3, 0.05);
}

.inbox-item:last-child {
    border-bottom: none;
}

.inbox-unread {
    border-left: 3px solid var(--lh-red);
    font-weight: 600;
}

.inbox-sender {
    font-size: 0.78rem;
    color: #CCC;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-subject {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-unread .inbox-subject {
    color: #CCC;
}

.inbox-date {
    font-size: 0.65rem;
    color: #666;
    text-align: right;
}

/* ---- Campaign status badges ---- */
.badge-draft { background-color: #6c757d; }
.badge-sending { background-color: #ffc107; color: #000; }
.badge-sent { background-color: #198754; }
.badge-failed { background-color: #dc3545; }

/* Progress bar for campaign sending */
.progress {
    border-radius: 4px;
}

.progress-bar {
    transition: width 0.5s ease;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---- AI Content Assist ---- */
.ai-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px 0;
}

.ai-btn {
    font-size: 0.82rem;
    padding: 4px 12px;
}

.ai-topic-input {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.ai-topic-input input {
    max-width: 350px;
}

/* Preview panel */
.ai-preview-panel {
    display: none;
    margin-top: 12px;
    border: 1px solid #0dcaf0;
    border-radius: 6px;
    background: #0d1117;
    overflow: hidden;
}

.ai-preview-header {
    background: rgba(13, 202, 240, 0.1);
    padding: 8px 14px;
    font-size: 0.8rem;
    color: #0dcaf0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.ai-preview-loading {
    display: none;
    padding: 24px 14px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

.ai-preview-loading .spinner-border {
    width: 1.2rem;
    height: 1.2rem;
    border-width: 2px;
    color: #0dcaf0;
}

.ai-preview-body {
    display: none;
    padding: 14px;
    color: #E0E0E0;
    font-size: 0.92rem;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
}

.ai-preview-body h1, .ai-preview-body h2, .ai-preview-body h3 {
    color: #FFF;
    margin-top: 0.8rem;
}

.ai-preview-body p { margin-bottom: 0.6rem; }
.ai-preview-body ul, .ai-preview-body ol { padding-left: 1.5rem; }

.ai-preview-actions {
    display: none;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #1a2030;
}

.ai-subject-suggestions {
    display: none;
    padding: 14px;
}

/* Tone dropdown dark theme */
.ai-toolbar .dropdown-menu {
    background: #1a1a1a;
    border-color: #333;
}

.ai-toolbar .dropdown-item {
    color: #CCC;
    font-size: 0.85rem;
}

.ai-toolbar .dropdown-item:hover {
    background: rgba(13, 202, 240, 0.15);
    color: #FFF;
}
