/* Ticketmaster Price Monitor - Modern UI with System Dark Mode */

/* ============================================
   CSS Custom Properties - Light Theme (Default)
   ============================================ */
:root {
    /* Primary colors */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    --primary-glow: rgba(59, 130, 246, 0.25);

    /* Status colors */
    --success-color: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning-color: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger-color: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);

    /* Background colors - Light Mode */
    --bg-color: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --card-bg: #ffffff;
    --card-bg-hover: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.5);

    /* Text colors - Light Mode */
    --text-color: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Border and shadow - Light Mode */
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

    /* Accent for prices */
    --price-accent: #059669;
    --price-accent-light: rgba(5, 150, 105, 0.1);

    /* Chart colors */
    --chart-line: #3b82f6;
    --chart-fill: rgba(59, 130, 246, 0.1);
    --chart-threshold: #ef4444;
    --chart-grid: #e2e8f0;
    --chart-text: #64748b;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Backdrop blur */
    --blur-sm: 8px;
    --blur-md: 12px;
    --blur-lg: 20px;

    /* Color scheme indicator */
    color-scheme: light dark;
}

/* ============================================
   Dark Mode Theme
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        /* Background colors - Dark Mode */
        --bg-color: #0c1222;
        --bg-secondary: #141d2f;
        --bg-tertiary: #1e293b;
        --card-bg: #1a2435;
        --card-bg-hover: #243147;
        --glass-bg: rgba(26, 36, 53, 0.85);
        --glass-border: rgba(59, 130, 246, 0.15);

        /* Text colors - Dark Mode */
        --text-color: #f1f5f9;
        --text-secondary: #94a3b8;
        --text-muted: #64748b;

        /* Border and shadow - Dark Mode */
        --border-color: #2a3a52;
        --border-hover: #3d5275;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
        --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);

        /* Price accent - brighter in dark mode */
        --price-accent: #22c55e;
        --price-accent-light: rgba(34, 197, 94, 0.15);

        /* Chart colors - Dark Mode */
        --chart-grid: #2a3a52;
        --chart-text: #64748b;
    }
}

/* ============================================
   Reset and Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Subtle background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, var(--primary-light) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, var(--price-accent-light) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

/* ============================================
   Container
   ============================================ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* ============================================
   Header
   ============================================ */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 20px 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-md));
    -webkit-backdrop-filter: blur(var(--blur-md));
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    flex-wrap: wrap;
    gap: 16px;
    transition: all var(--transition-normal);
}

header:hover {
    box-shadow: var(--shadow-xl);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-brand .logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: transform var(--transition-bounce), box-shadow var(--transition-normal);
}

.header-brand .logo:hover {
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* WebSocket Status Indicator */
.ws-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.813rem;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.ws-status:hover {
    border-color: var(--border-hover);
}

.ws-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.ws-dot.connected {
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color), 0 0 20px rgba(16, 185, 129, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.ws-dot.disconnected {
    background-color: var(--danger-color);
    box-shadow: 0 0 6px var(--danger-color);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

.ws-text {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Worker Status */
.worker-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
}

.worker-status:hover {
    border-color: var(--border-hover);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    transition: all var(--transition-normal);
}

.status-dot.active {
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.inactive {
    background-color: var(--danger-color);
    box-shadow: 0 0 6px var(--danger-color);
}

.connection-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.last-check {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.813rem;
}

/* ============================================
   Cards - Glassmorphism Style
   ============================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card:hover::before {
    opacity: 1;
}

.card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card h2 .icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.card:hover h2 .icon {
    opacity: 1;
}

/* ============================================
   Forms
   ============================================ */
.form-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.form-row input[type="url"] {
    flex: 1;
}

input[type="url"],
input[type="text"],
input[type="number"] {
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.938rem;
    color: var(--text-color);
    transition: all var(--transition-normal);
    outline: none;
}

input[type="url"]::placeholder,
input[type="text"]::placeholder,
input[type="number"]::placeholder {
    color: var(--text-muted);
}

input[type="url"]:hover,
input[type="text"]:hover,
input[type="number"]:hover {
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
}

input[type="url"]:focus,
input[type="text"]:focus,
input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: var(--card-bg);
}

input[type="number"] {
    width: 160px;
}

/* ============================================
   Buttons
   ============================================ */
button {
    padding: 14px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.938rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left var(--transition-slow);
}

button:hover:not(:disabled)::before {
    left: 100%;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
}

button:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button[type="submit"],
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    box-shadow: var(--shadow-sm), 0 4px 12px rgba(59, 130, 246, 0.25);
}

button[type="submit"]:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #1d4ed8 100%);
    box-shadow: var(--shadow), 0 6px 16px rgba(59, 130, 246, 0.35);
}

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-light) 0%, rgba(239, 68, 68, 0.2) 100%);
    color: var(--danger-color);
    border: 1px solid transparent;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-small {
    padding: 10px 16px;
    font-size: 0.813rem;
}

.btn-icon {
    padding: 8px 10px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

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

/* ============================================
   Monitor Cards
   ============================================ */
.monitor-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    transition: all var(--transition-normal);
    position: relative;
}

.monitor-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, var(--primary-light) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.monitor-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.monitor-card:hover::after {
    opacity: 1;
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.monitor-info {
    flex: 1;
    min-width: 250px;
}

.event-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.event-url {
    font-size: 0.813rem;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.event-url:hover {
    color: var(--primary-hover);
    background: var(--primary-glow);
}

.monitor-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    transition: all var(--transition-normal);
}

.status-badge.idle {
    background: linear-gradient(135deg, var(--success-light) 0%, rgba(16, 185, 129, 0.2) 100%);
    color: var(--success-color);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.status-badge.checking {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(59, 130, 246, 0.2) 100%);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    animation: statusPulse 1.5s ease-in-out infinite;
}

.status-badge.error {
    background: linear-gradient(135deg, var(--danger-light) 0%, rgba(239, 68, 68, 0.2) 100%);
    color: var(--danger-color);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.last-checked {
    font-size: 0.813rem;
    color: var(--text-muted);
}

/* Monitor Details */
.monitor-details {
    margin-bottom: 24px;
}

.detail-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all var(--transition-normal);
}

.detail-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.detail-item label {
    font-size: 0.688rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

.detail-value {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.threshold-value {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-color);
}

.price-value .price {
    font-weight: 800;
    font-size: 1.375rem;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.price.below-threshold {
    background: linear-gradient(135deg, var(--success-light) 0%, rgba(16, 185, 129, 0.2) 100%);
    color: var(--success-color);
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.2);
}

.price.above-threshold {
    background: linear-gradient(135deg, var(--warning-light) 0%, rgba(245, 158, 11, 0.2) 100%);
    color: var(--warning-color);
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.2);
}

.price.price-updated {
    animation: priceFlash 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes priceFlash {
    0% { transform: scale(1); }
    30% { transform: scale(1.15); box-shadow: 0 0 30px var(--success-color); }
    100% { transform: scale(1); }
}

.ticket-count {
    font-size: 0.813rem;
    color: var(--text-muted);
}

/* Best Price */
.best-price-item .detail-value {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.best-price {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--price-accent);
    transition: all var(--transition-normal);
}

.best-price.new-best {
    animation: newBestPulse 2.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes newBestPulse {
    0% { transform: scale(1); }
    20% { transform: scale(1.2); color: var(--warning-color); }
    40% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.best-location {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.best-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.no-data {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

/* ============================================
   Top Tickets Section
   ============================================ */
.top-tickets-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.top-tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.top-tickets-header h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-tickets-header .icon {
    color: var(--price-accent);
}

.tickets-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tickets-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.688rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.tickets-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.tickets-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.tickets-table tbody tr {
    transition: all var(--transition-fast);
}

.tickets-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.tickets-table tbody td {
    padding: 14px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
}

.tickets-table tbody tr:last-child td {
    border-bottom: none;
}

.tickets-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 var(--radius-sm);
}

.tickets-table tbody tr:last-child td:last-child {
    border-radius: 0 0 var(--radius-sm) 0;
}

.ticket-rank {
    width: 48px;
}

/* Simple numeric rank */
.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    font-size: 0.813rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.ticket-price {
    font-weight: 800;
    color: var(--price-accent);
    font-size: 0.938rem;
}

.ticket-section,
.ticket-row {
    color: var(--text-secondary);
}

.no-tickets-message {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.top-tickets-section.tickets-updated .tickets-table tbody {
    animation: ticketsHighlight 0.6s ease;
}

@keyframes ticketsHighlight {
    0% { background-color: transparent; }
    50% { background-color: var(--price-accent-light); }
    100% { background-color: transparent; }
}

/* ============================================
   Error Message
   ============================================ */
.error-message {
    margin-top: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--danger-light) 0%, rgba(239, 68, 68, 0.15) 100%);
    border-left: 4px solid var(--danger-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--danger-color);
}

/* ============================================
   Monitor Actions
   ============================================ */
.monitor-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Chart Section
   ============================================ */
.chart-section {
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-header h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.chart-controls {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.chart-controls .time-range {
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    border: none;
}

.chart-controls .time-range:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    transform: none;
}

.chart-controls .time-range.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.chart-container {
    position: relative;
    height: 240px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.no-chart-data {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

/* ============================================
   Settings Section
   ============================================ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

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

.form-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Token Status */
.token-status {
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    transition: all var(--transition-normal);
}

.token-status.configured {
    background: linear-gradient(135deg, var(--success-light) 0%, rgba(16, 185, 129, 0.15) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.token-status.not-configured {
    background: linear-gradient(135deg, var(--warning-light) 0%, rgba(245, 158, 11, 0.15) 100%);
    border-color: rgba(245, 158, 11, 0.3);
}

.token-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.688rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.token-badge.configured {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
}

.token-badge.not-configured {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
}

.token-status small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.settings-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================
   Spinner
   ============================================ */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Toast Notifications
   ============================================ */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    color: white;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 300px;
    max-width: 440px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
}

.toast.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    box-shadow: var(--shadow-lg), 0 4px 20px rgba(16, 185, 129, 0.3);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    box-shadow: var(--shadow-lg), 0 4px 20px rgba(239, 68, 68, 0.3);
}

.toast.info {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    box-shadow: var(--shadow-lg), 0 4px 20px rgba(59, 130, 246, 0.3);
}

.toast.fade-out {
    animation: fadeOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100px) scale(0.9);
    }
}

/* ============================================
   Footer
   ============================================ */
footer {
    text-align: center;
    padding: 28px;
    color: var(--text-muted);
    font-size: 0.813rem;
    border-top: 1px solid var(--border-color);
    margin-top: 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ============================================
   Loading State
   ============================================ */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

/* ============================================
   No Monitors Message
   ============================================ */
.no-monitors {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-muted);
    font-size: 0.938rem;
}

.no-monitors-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.4;
    transition: all var(--transition-normal);
}

.no-monitors:hover .no-monitors-icon {
    opacity: 0.6;
    transform: scale(1.05);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .header-status {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 12px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row input[type="url"],
    .form-row input[type="number"] {
        width: 100%;
    }

    .monitor-header {
        flex-direction: column;
    }

    .monitor-status {
        width: 100%;
    }

    .detail-row {
        grid-template-columns: 1fr;
    }

    .monitor-actions {
        flex-direction: column;
    }

    .monitor-actions button {
        width: 100%;
    }

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions button {
        width: 100%;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tickets-table {
        font-size: 0.813rem;
    }

    .tickets-table thead th,
    .tickets-table tbody td {
        padding: 12px 10px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.25rem;
    }

    .event-name {
        font-size: 1.125rem;
    }

    .card {
        padding: 20px;
    }

    .monitor-card {
        padding: 20px;
    }

    .detail-item {
        padding: 12px;
    }
}

/* ============================================
   Settings Subsections
   ============================================ */
.settings-subsection {
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-subsection:first-of-type {
    padding-top: 0;
}

.settings-subsection:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-subsection h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-subsection h3 .icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.settings-description {
    font-size: 0.813rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.settings-description a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.settings-description a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Input with status indicator */
.input-with-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-with-status input {
    flex: 1;
}

.key-status {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.688rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.key-status.configured {
    background: linear-gradient(135deg, var(--success-light) 0%, rgba(16, 185, 129, 0.2) 100%);
    color: var(--success-color);
}

.key-status.not-configured {
    background: linear-gradient(135deg, var(--warning-light) 0%, rgba(245, 158, 11, 0.2) 100%);
    color: var(--warning-color);
}

/* ============================================
   Admin Mode Styles
   ============================================ */
.admin-status {
    margin-bottom: 16px;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    font-size: 0.813rem;
    font-weight: 700;
    transition: all var(--transition-normal);
}

.admin-badge.inactive {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.admin-badge.active {
    background: linear-gradient(135deg, var(--success-light) 0%, rgba(16, 185, 129, 0.2) 100%);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

/* Danger outline button */
.btn-danger-outline {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.btn-danger-outline:hover:not(:disabled) {
    background: var(--danger-light);
}

/* ============================================
   Focus Visible Styles (Accessibility)
   ============================================ */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================
   Selection Styles
   ============================================ */
::selection {
    background-color: var(--primary-glow);
    color: var(--text-color);
}

/* ============================================
   Admin Pushover Keys Table
   ============================================ */
.pushover-keys-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 16px;
}

.pushover-keys-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.688rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.pushover-keys-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.pushover-keys-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.pushover-keys-table tbody tr {
    transition: all var(--transition-fast);
}

.pushover-keys-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.pushover-keys-table tbody td {
    padding: 14px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.pushover-keys-table tbody tr:last-child td {
    border-bottom: none;
}

.pushover-keys-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 var(--radius-sm);
}

.pushover-keys-table tbody tr:last-child td:last-child {
    border-radius: 0 0 var(--radius-sm) 0;
}

.pushover-keys-table .browser-id-cell {
    font-family: monospace;
    font-size: 0.813rem;
    color: var(--text-muted);
}

.pushover-keys-table .user-key-cell {
    font-family: monospace;
    font-size: 0.813rem;
    color: var(--primary-color);
}

.pushover-keys-table .actions-cell {
    text-align: right;
}

.pushover-keys-loading {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

.no-keys-message {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.keys-error-message {
    text-align: center;
    padding: 32px;
    color: var(--danger-color);
    font-size: 0.875rem;
    background: var(--danger-light);
    border-radius: var(--radius-md);
}

/* ============================================
   Scrollbar Styles
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 5px;
    border: 2px solid var(--bg-secondary);
}

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

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-hover) var(--bg-secondary);
}
