/**
 * SPX AI Prediction - Dark Theme
 * Shared CSS for all pages
 * Version: 1.0
 */

/* ============================================
   CSS Variables (Dark Theme)
   ============================================ */
:root {
    /* Background Colors */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    --bg-card-hover: #252b33;
    --bg-input: #21262d;

    /* Text Colors */
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-link: #58a6ff;

    /* Accent Colors */
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-success: #3fb950;
    --accent-warning: #d29922;
    --accent-danger: #f85149;
    --accent-info: #58a6ff;

    /* Border Colors */
    --border-color: #30363d;
    --border-light: #21262d;

    /* Chart Colors */
    --chart-green: #3fb950;
    --chart-red: #f85149;
    --chart-blue: #58a6ff;
    --chart-purple: #a371f7;
    --chart-orange: #f0883e;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #3fb950 0%, #238636 100%);
    --gradient-danger: linear-gradient(135deg, #f85149 0%, #da3633 100%);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   Layout Components
   ============================================ */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: var(--bg-card);
    padding: 20px 30px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Page Title */
.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    transition: var(--transition-normal);
}

.card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--gradient-primary);
    margin-right: 10px;
    border-radius: 2px;
}

.chart-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 20px;
}

.chart-box h3 {
    text-align: center;
    color: var(--accent-primary);
    margin-bottom: 15px;
}

/* ============================================
   Grid Layouts
   ============================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px auto;
    max-width: 1400px;
}

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

/* ============================================
   Buttons
   ============================================ */
button {
    font-family: inherit;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-secondary);
}

.logout-btn {
    padding: 8px 16px;
    background: var(--accent-danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    background: #da3633;
}

.refresh-btn {
    padding: 8px 16px;
    background: var(--accent-success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition-fast);
}

.refresh-btn:hover {
    background: #238636;
}

.refresh-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.refresh-btn.loading {
    background: var(--accent-warning);
}

.subscribe-btn {
    background: var(--accent-success);
    padding: 12px 25px;
    color: white;
    border: none;
    cursor: pointer;
    margin: 15px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.subscribe-btn:hover {
    background: #238636;
}

/* Navigation Links */
.back-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    margin-right: 10px;
    transition: var(--transition-fast);
    font-size: 14px;
}

.back-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ============================================
   Forms & Inputs
   ============================================ */
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    color: var(--text-primary);
    font-size: 14px;
    width: 200px;
    margin: 10px;
    transition: var(--transition-fast);
}

input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

input::placeholder {
    color: var(--text-muted);
}

/* Auth Section */
.auth-section {
    text-align: center;
    padding: 20px;
}

.auth-section button {
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin: 5px;
    transition: var(--transition-fast);
}

.auth-section button:hover {
    opacity: 0.9;
}

/* ============================================
   Badges & Labels
   ============================================ */
.info-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 10px;
}

.auto-refresh-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-success);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: white;
    margin-left: 10px;
}

.market-hours-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--accent-warning);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.market-hours-badge.open {
    background: var(--accent-success);
}

.market-hours-badge.closed {
    background: var(--accent-danger);
}

.bias-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
}

.bias-badge.bullish {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.bias-badge.bearish {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
}

.bias-badge.neutral {
    background: rgba(139, 148, 158, 0.2);
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

/* ============================================
   Metrics & Indicators
   ============================================ */
.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
    margin-bottom: 10px;
}

.metric-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-value.positive,
.metric-value.high {
    color: var(--accent-success);
}

.metric-value.negative,
.metric-value.low {
    color: var(--accent-danger);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.metric-item {
    background: var(--bg-input);
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
}

/* Score Displays */
.score-container {
    text-align: center;
    padding: 30px;
}

.score-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.score-value {
    font-size: 96px;
    font-weight: 700;
    line-height: 1;
}

.score-value.bullish {
    color: var(--accent-success);
}

.score-value.bearish {
    color: var(--accent-danger);
}

.score-value.neutral {
    color: var(--text-secondary);
}

.score-status {
    font-size: 28px;
    font-weight: 600;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.score-detail-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.score-detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.score-detail-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Health Score */
.health-score-container {
    text-align: center;
}

.health-score-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.health-score {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
}

.health-score-status {
    font-size: 24px;
    font-weight: 600;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.health-score.healthy {
    color: var(--accent-success);
}

.health-score.neutral {
    color: var(--accent-warning);
}

.health-score.cautious {
    color: var(--chart-orange);
}

.health-score.warning {
    color: var(--accent-danger);
}

/* ============================================
   Price Displays
   ============================================ */
.live-price {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
}

.price-change {
    color: var(--accent-success);
    font-size: 24px;
    margin-left: 15px;
}

.price-change.negative {
    color: var(--accent-danger);
}

.next-session {
    text-align: right;
}

.next-session-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.next-session-price {
    font-size: 36px;
    font-weight: 600;
    color: var(--accent-primary);
}

/* ============================================
   Indicator Cards
   ============================================ */
.indicator-card {
    background: var(--bg-input);
    padding: 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-primary);
    margin-bottom: 15px;
}

.indicator-card.risk-on,
.indicator-card.normal {
    border-left-color: var(--accent-success);
    background: rgba(63, 185, 80, 0.1);
}

.indicator-card.risk-off,
.indicator-card.inverted {
    border-left-color: var(--accent-danger);
    background: rgba(248, 81, 73, 0.1);
}

.indicator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.indicator-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.indicator-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.indicator-status.risk-on,
.indicator-status.normal,
.indicator-status.low,
.indicator-status.moderate,
.indicator-status.growth {
    background: var(--accent-success);
    color: white;
}

.indicator-status.risk-off,
.indicator-status.inverted,
.indicator-status.high,
.indicator-status.extreme {
    background: var(--accent-danger);
    color: white;
}

.indicator-status.elevated,
.indicator-status.defensive,
.indicator-status.complacent {
    background: var(--accent-warning);
    color: white;
}

.indicator-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 10px 0;
}

.indicator-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ============================================
   Component Lists
   ============================================ */
.component-list {
    list-style: none;
    padding: 0;
}

.component-item {
    padding: 15px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

.component-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.component-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.component-value {
    font-size: 24px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    min-width: 80px;
    text-align: center;
}

.component-value.positive {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-success);
}

.component-value.negative {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-danger);
}

.component-value.neutral {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Factors List */
.factors-list {
    list-style: none;
    padding: 0;
}

.factors-list li {
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    border-left: 3px solid var(--border-color);
}

.factors-list li::before {
    content: '• ';
    color: var(--accent-primary);
    font-weight: bold;
    margin-right: 8px;
}

/* Signal Cards */
.signal-card {
    background: var(--bg-input);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
}

.signal-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 15px 0;
}

.signal-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   Briefing Styles
   ============================================ */
.briefing-content {
    line-height: 1.8;
    color: var(--text-primary);
}

.briefing-section {
    margin-bottom: 25px;
}

.briefing-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.briefing-section p {
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--text-secondary);
}

/* Archive */
.archive-list {
    max-height: 400px;
    overflow-y: auto;
}

.archive-item {
    padding: 15px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    border-left: 3px solid var(--border-color);
}

.archive-item:hover {
    background: var(--bg-card-hover);
    border-left-color: var(--accent-primary);
    transform: translateX(5px);
}

.archive-item.active {
    background: var(--bg-card-hover);
    border-left-color: var(--accent-primary);
}

.archive-date {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.archive-preview {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   Futures Widget
   ============================================ */
.futures-widget {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    padding: 15px 25px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.futures-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.futures-price {
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.futures-change {
    font-size: 18px;
    font-weight: 600;
    margin-left: 12px;
}

.futures-change.positive {
    color: #68d391;
}

.futures-change.negative {
    color: #fc8181;
}

.futures-stats {
    display: flex;
    gap: 25px;
    align-items: center;
}

.futures-stat {
    text-align: center;
}

.futures-stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.futures-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.futures-update {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

/* ============================================
   Confidence Bar
   ============================================ */
.confidence-bar {
    margin-top: 10px;
}

.confidence-bar-bg {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-bar-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* ============================================
   Loading & Error States
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 17, 23, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    margin-top: 20px;
    color: var(--text-secondary);
}

.error-message {
    background: rgba(248, 81, 73, 0.1);
    color: var(--accent-danger);
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent-danger);
    margin: 20px auto;
    max-width: 600px;
    text-align: center;
}

.error-message a {
    color: var(--text-link);
}

/* ============================================
   Timestamps & Info
   ============================================ */
.timestamp {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

.user-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.chart-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 10px;
}

/* ============================================
   TradingView Container
   ============================================ */
.tradingview-widget-container {
    width: 100%;
    height: 500px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.tradingview-small {
    width: 100%;
    height: 400px;
}

.prediction-chart-container {
    position: relative;
    height: 350px;
    margin-top: 15px;
}

/* ============================================
   Sections
   ============================================ */
section {
    margin: 20px auto;
    max-width: 1400px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

section h2 {
    text-align: center;
    color: var(--accent-primary);
    margin-bottom: 20px;
}

/* ============================================
   Footer
   ============================================ */
footer {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.5;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    border-radius: var(--radius-md);
}

footer a {
    color: var(--text-link);
    text-decoration: none;
    margin: 0 5px;
}

footer a:hover {
    text-decoration: underline;
}

.disclaimer-text {
    margin-bottom: 10px;
    font-size: 10px;
    color: var(--text-muted);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links {
    margin-top: 8px;
    font-size: 10px;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

.error {
    color: var(--accent-danger);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .dashboard {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .grid,
    .grid-2col,
    .chart-row {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .header-right {
        margin-top: 15px;
        flex-direction: column;
        gap: 10px;
    }

    .next-session {
        text-align: center;
        margin-top: 15px;
    }

    .live-price {
        font-size: 36px;
    }

    .score-value {
        font-size: 64px;
    }

    .health-score {
        font-size: 54px;
    }

    .score-details {
        grid-template-columns: 1fr;
    }

    .tradingview-widget-container {
        height: 300px;
    }

    .tradingview-small {
        height: 300px;
    }

    .prediction-chart-container {
        height: 250px;
    }

    .futures-widget {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .futures-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .back-link {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    body {
        background: white;
        color: black;
        padding: 0;
    }

    .header-right,
    .action-buttons,
    .back-link,
    footer,
    .archive-section,
    .refresh-btn,
    .logout-btn {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Unified Navigation Component
   ============================================ */
.nav-container,
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0;
}

.nav-link,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover,
.back-link:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.nav-link.active {
    background: var(--gradient-primary) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

/* Navigation within header for index.html */
.premium-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.premium-nav-links .nav-link {
    padding: 8px 16px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .nav-container,
    .nav-links {
        justify-content: center;
    }

    .nav-link,
    .back-link {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ============================================
   Account Dropdown Component
   ============================================ */

/* Fixed position container - stays at top-right corner */
.account-dropdown-wrapper {
    position: fixed !important;
    top: 15px !important;
    right: 20px !important;
    z-index: 10000 !important;
    pointer-events: auto !important;
}

.account-dropdown {
    position: relative;
    display: inline-block;
}

.account-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-primary);
}

.account-trigger:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.account-info {
    text-align: left;
    line-height: 1.3;
}

.account-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.account-plan {
    font-size: 11px;
    color: var(--accent-success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.account-plan .plan-badge {
    background: var(--accent-success);
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.account-chevron {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.account-dropdown.open .account-chevron {
    transform: rotate(180deg);
}

.account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: var(--transition-fast);
    z-index: 10001 !important;
}

.account-dropdown.open .account-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.account-menu-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.account-menu-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    word-break: break-all;
}

.account-menu-section {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.account-menu-section:last-child {
    border-bottom: none;
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.account-menu-item:hover {
    background: var(--bg-card-hover);
}

.account-menu-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.account-menu-item.danger {
    color: var(--accent-danger);
}

.account-menu-item.danger svg {
    color: var(--accent-danger);
}

.plan-upgrade-banner {
    margin: 8px;
    padding: 12px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    text-align: center;
}

.plan-upgrade-banner a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.plan-upgrade-banner a:hover {
    text-decoration: underline;
}
