/* ====================================================================
   INTELLIGENCE PAGE — Timeline, Budget, Stats, Forms, Cases
   Extracted from intelligence.html inline styles (Part 3)
   ==================================================================== */

/* --- Version Timeline --- */
.timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 20px 0;
    overflow-x: auto;
}

.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 0 8px;
    flex-shrink: 0;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3f3f46;
    border: 2px solid #2a2a35;
    transition: all 0.2s ease;
}

.timeline-node:hover .timeline-dot {
    background: #646cff;
    border-color: #646cff;
    box-shadow: 0 0 12px rgba(100, 108, 255, 0.4);
}

.timeline-node.current .timeline-dot {
    background: #646cff;
    border-color: #818cf8;
    box-shadow: 0 0 12px rgba(100, 108, 255, 0.4);
}

.timeline-label {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: #71717a;
    white-space: nowrap;
}

.timeline-node.current .timeline-label {
    color: #646cff;
    font-weight: 700;
}

.timeline-line {
    width: 40px;
    height: 2px;
    background: #2a2a35;
    flex-shrink: 0;
}

/* --- Budget Bar --- */
.budget-bar-container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.budget-bar-track {
    flex: 1;
    height: 14px;
    background: rgba(42, 42, 53, 0.5);
    border-radius: 7px;
    overflow: hidden;
}

.budget-bar-fill {
    height: 100%;
    border-radius: 7px;
    background: linear-gradient(90deg, #646cff, #818cf8);
    transition: width 0.5s ease;
}

.budget-bar-fill.warn {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.budget-bar-fill.full {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.budget-label {
    font-size: 13px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: #a1a1aa;
    flex-shrink: 0;
}

/* --- Stat Cards (3-wide) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #1a1a24;
    border: 1px solid #2a2a35;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #fafafa;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #71717a;
    margin-top: 6px;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.filter-bar select {
    background: #1a1a24;
    border: 1px solid #2a2a35;
    color: #a1a1aa;
    padding: 8px 32px 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s ease;
}

.filter-bar select:hover { border-color: #3f3f46; }
.filter-bar select:focus { outline: none; border-color: #646cff; }

.filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #71717a;
}

/* --- Rules Form --- */
.rules-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #71717a;
}

.form-group input[type="number"],
.form-group textarea {
    background: #0f0f14;
    border: 1px solid #2a2a35;
    color: #fafafa;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.15s ease;
}

.form-group input[type="number"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #646cff;
    box-shadow: 0 0 0 3px rgba(100, 108, 255, 0.1);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #2a2a35;
    border-radius: 11px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #71717a;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #646cff;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: #fafafa;
}

.toggle-label {
    font-size: 13px;
    color: #a1a1aa;
}

.save-btn {
    background: #646cff;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.save-btn:hover {
    background: #5558e6;
    box-shadow: 0 4px 16px rgba(100, 108, 255, 0.3);
}

.save-btn:active {
    transform: translateY(1px);
}

.save-btn.saved {
    background: #16a34a;
}

/* --- Loading Spinner --- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    flex-direction: column;
    gap: 14px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #2a2a35;
    border-top-color: #646cff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 13px;
    color: #71717a;
    font-weight: 500;
}

/* --- Empty State (Intelligence) --- */
.intel-page .empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #71717a;
}

.intel-page .empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-title {
    font-size: 15px;
    font-weight: 600;
    color: #a1a1aa;
    margin-bottom: 4px;
}

.empty-desc {
    font-size: 13px;
}

/* --- Case Memory Card --- */
.case-card {
    background: rgba(42, 42, 53, 0.2);
    border: 1px solid #2a2a35;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.case-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.case-header:hover {
    background: rgba(42, 42, 53, 0.4);
}

.case-ticker {
    font-size: 14px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #fafafa;
}

.case-date {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: #71717a;
    margin-left: 10px;
}

.case-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.case-card.open .case-body {
    max-height: 600px;
}

.case-body-inner {
    padding: 0 16px 14px;
    font-size: 12px;
    color: #a1a1aa;
    line-height: 1.6;
    font-family: 'JetBrains Mono', monospace;
}

/* --- Horizon star marker --- */
.horizon-star {
    color: #fbbf24;
    margin-left: 4px;
    font-size: 14px;
}

/* --- Two-column layout --- */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .process-grid { grid-template-columns: 1fr; }
    .rules-form { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .intel-page { padding: 16px 12px 40px; }
    .metrics-grid { grid-template-columns: 1fr; }
    .tab-bar { flex-wrap: nowrap; }
    .tab-btn { min-width: 80px; font-size: 11px; padding: 8px 10px; }
}
