/**
 * Token Research Generator Web Interface Styles
 * "Aurora Terminal" design system — mint-on-obsidian with dark/light mode support
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* CSS Variables - Dark Theme (Default) */
:root {
    /* Core colors */
    --bg-primary: #07100d;
    --bg-secondary: #0c1714;
    --bg-tertiary: #13211c;
    --bg-card: #0e1a16;
    --bg-hover: #16261f;
    --surface-color: #0e1a16;
    --card-bg: #0e1a16;
    
    /* Text colors */
    --text-color: #e9f5ef;
    --text-primary: #e9f5ef;
    --text-secondary: #94aca1;
    --text-muted: #5e7269;
    
    /* Border colors */
    --border-color: rgba(170, 230, 205, 0.10);
    --border-accent: rgba(54, 226, 170, 0.35);
    
    /* Accent colors */
    --accent-primary: #36e2aa;
    --accent-primary-dark: #17c98d;
    --accent-bright: #6cf2c4;
    --text-on-accent: #04231a;
    --primary-color: #36e2aa;
    --primary-dark: #17c98d;
    --accent-purple: #36e2aa;
    --accent-purple-dark: #17c98d;
    --accent-blue: #38bdf8;
    --accent-cyan: #22d3ee;
    --accent-green: #34d399;
    --accent-red: #ff5c7a;
    --accent-orange: #fbbf24;
    --accent-pink: #f472b6;
    
    /* Semantic colors */
    --success-color: #34d399;
    --success-dark: #0fa974;
    --warning-color: #fbbf24;
    --warning-dark: #d99a06;
    --danger-color: #ff5c7a;
    --danger-dark: #e63e5e;
    --info-color: #38bdf8;
    --info-dark: #0ea5e9;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #36e2aa 0%, #2bd4c2 55%, #38bdf8 100%);
    --gradient-dark: linear-gradient(135deg, #0c1714 0%, #0e2019 50%, #0b2422 100%);
    --gradient-card: linear-gradient(145deg, rgba(54, 226, 170, 0.05) 0%, transparent 100%);
    --gradient-bg: radial-gradient(ellipse 80% 50% at 15% -10%, rgba(54, 226, 170, 0.10) 0%, transparent 60%),
                   radial-gradient(ellipse 70% 50% at 90% 0%, rgba(56, 189, 248, 0.07) 0%, transparent 55%),
                   radial-gradient(ellipse 60% 45% at 50% 110%, rgba(34, 211, 238, 0.06) 0%, transparent 60%);
    
    /* Shadows */
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 10px 34px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 40px rgba(54, 226, 170, 0.14);
    --shadow-card: 0 1px 0 rgba(170, 230, 205, 0.05) inset, 0 4px 24px rgba(0, 0, 0, 0.42);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    
    /* Spacing & Radius */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-full: 999px;
    --border-radius: 10px;
    --border-radius-lg: 14px;
    
    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Legacy compatibility */
    --bg-color: var(--bg-primary);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f2f6f3;
    --bg-secondary: #eaf0ec;
    --bg-tertiary: #dfe8e2;
    --bg-card: #ffffff;
    --bg-hover: #e4ece7;
    --surface-color: #ffffff;
    --card-bg: #ffffff;
    
    --text-color: #15241e;
    --text-primary: #15241e;
    --text-secondary: #49594f;
    --text-muted: #87988e;
    
    --border-color: rgba(21, 45, 35, 0.12);
    --border-accent: rgba(12, 155, 118, 0.45);
    
    --accent-primary: #0c9b76;
    --accent-primary-dark: #0a8263;
    --accent-bright: #0c9b76;
    --text-on-accent: #ffffff;
    --primary-color: #0c9b76;
    --primary-dark: #0a8263;
    --accent-purple: #0c9b76;
    --accent-purple-dark: #0a8263;
    --accent-blue: #0284c7;
    --accent-cyan: #0891b2;
    --accent-green: #0fa974;
    --accent-red: #e11d48;
    --accent-orange: #d97706;
    --accent-pink: #db2777;
    
    --success-color: #0fa974;
    --success-dark: #0c8a60;
    --warning-color: #d97706;
    --warning-dark: #b45309;
    --danger-color: #e11d48;
    --danger-dark: #be123c;
    --info-color: #0284c7;
    --info-dark: #0369a1;
    
    --gradient-primary: linear-gradient(135deg, #0c9b76 0%, #0b9e95 55%, #0284c7 100%);
    
    --shadow: 0 4px 20px rgba(21, 45, 35, 0.08);
    --shadow-hover: 0 10px 30px rgba(21, 45, 35, 0.13);
    --shadow-glow: 0 0 40px rgba(12, 155, 118, 0.10);
    --shadow-card: 0 1px 2px rgba(21, 45, 35, 0.05), 0 4px 18px rgba(21, 45, 35, 0.07);
    
    --gradient-bg: radial-gradient(ellipse 80% 50% at 15% -10%, rgba(12, 155, 118, 0.07) 0%, transparent 60%),
                   radial-gradient(ellipse 70% 50% at 90% 0%, rgba(2, 132, 199, 0.05) 0%, transparent 55%);
    --gradient-card: linear-gradient(145deg, rgba(12, 155, 118, 0.03) 0%, transparent 100%);
    
    --bg-color: var(--bg-primary);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    letter-spacing: -0.015em;
}

::selection {
    background: rgba(54, 226, 170, 0.28);
    color: var(--text-primary);
}

/* Aurora background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-bg);
    pointer-events: none;
    z-index: -1;
}

/* Faint dot-grid texture over the aurora */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(170, 230, 205, 0.05) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 55%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 55%);
    pointer-events: none;
    z-index: -1;
}

[data-theme="light"] body::after {
    background-image: radial-gradient(rgba(21, 45, 35, 0.06) 1px, transparent 1px);
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Multi-page Layout */
.page-container {
    min-height: calc(100vh - 60px);
    background: var(--bg-primary);
}

.page-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .page-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 0.75rem;
    }
}

.header {
    background: rgba(9, 19, 16, 0.88);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.9);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 16px;
}

.header h1 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 i {
    font-size: 1.1em;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(54, 226, 170, 0.1);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.theme-toggle i {
    font-size: 16px;
}

.theme-toggle .theme-label {
    display: none;
}

@media (min-width: 768px) {
    .theme-toggle .theme-label {
        display: inline;
    }
}

/* Header Actions Container */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: var(--transition);
}

.status-dot.idle {
    background-color: var(--text-muted);
}

.status-dot.running {
    background-color: var(--info-color);
    animation: pulse 2s infinite;
}

.status-dot.completed {
    background-color: var(--success-color);
}

.status-dot.error {
    background-color: var(--danger-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.main-content {
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Panels */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 24px;
}

.panel:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(54, 226, 170, 0.18);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(54, 226, 170, 0.05) 0%, transparent 60%);
}

.panel-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h2 i {
    color: var(--accent-primary);
    font-size: 1em;
}

.panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.panel-content {
    padding: 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-large {
    padding: 12px 24px;
    font-size: var(--font-size-base);
}

.btn-primary {
    color: var(--text-on-accent);
    background: var(--accent-primary);
    border-color: transparent;
    box-shadow: 0 4px 18px rgba(54, 226, 170, 0.28);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-bright);
    transform: translateY(-1px);
    box-shadow: 0 6px 26px rgba(54, 226, 170, 0.4);
}

[data-theme="light"] .btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-dark);
}

.btn-success {
    color: #04231a;
    background-color: var(--accent-green);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(52, 211, 153, 0.3);
}

[data-theme="light"] .btn-success {
    color: #ffffff;
}

.btn-success:hover:not(:disabled) {
    background-color: var(--success-dark);
    border-color: transparent;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.4);
}

.btn-secondary {
    color: var(--text-secondary);
    background-color: transparent;
    border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(54, 226, 170, 0.08);
    border-color: var(--border-accent);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-secondary.active {
    color: var(--text-on-accent);
    background: var(--accent-primary);
    border-color: transparent;
}

.btn-info {
    color: #062536;
    background-color: var(--accent-blue);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

[data-theme="light"] .btn-info {
    color: #ffffff;
}

.btn-info:hover:not(:disabled) {
    background-color: var(--info-dark);
    border-color: transparent;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn.changed {
    background-color: var(--warning-color);
    border-color: var(--warning-dark);
    color: var(--text-color);
}

/* Forms */
.config-form {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-section h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-color);
    font-size: var(--font-size-sm);
}

.form-group input {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    background-color: var(--bg-secondary);
    color: var(--text-color);
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(54, 226, 170, 0.15);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkmark {
    font-size: var(--font-size-sm);
}

/* Control Panel */
.control-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.control-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.info-item {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
}

.info-label {
    font-weight: 600;
    color: var(--text-muted);
}

/* Progress Panel */
.progress-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.progress-bar-container {
    position: relative;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--info-color) 100%);
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.2) 50%, transparent 60%);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.progress-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.progress-label {
    font-weight: 500;
    color: var(--text-muted);
}

/* Results Panel */
.reports-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.report-date-group h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.report-files {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.report-file {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.report-file:hover {
    background-color: var(--surface-color);
    box-shadow: var(--shadow);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.file-info i {
    color: var(--primary-color);
    width: 20px;
}

.file-name {
    font-weight: 500;
    color: var(--text-color);
}

.file-meta {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-left: auto;
    margin-right: 1rem;
}

/* Logs Panel */
.logs-container {
    max-height: 70vh;  /* Much taller - 70% of viewport height */
    min-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-color);
    scroll-behavior: smooth;
}

.logs-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

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

.logs-hint i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.log-count-badge {
    font-size: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    font-weight: 500;
}

.log-count-badge.error-badge {
    background-color: var(--danger-color, #ff5c7a);
}

.log-count-badge.error-badge.has-errors {
    animation: pulse-error 2s infinite;
}

@keyframes pulse-error {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Log Sub-Tabs */
.log-sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.log-sub-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s ease;
}

.log-sub-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.log-sub-tab.active {
    background: var(--primary-color);
    color: white;
}

.log-sub-tab.active .log-count-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.log-sub-tab.active .log-count-badge.error-badge {
    background: rgba(255, 255, 255, 0.4);
}

/* Log Views */
.logs-view {
    display: none;
}

.logs-view.active {
    display: block;
}

.log-entry {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.info {
    background-color: rgba(23, 162, 184, 0.1);
}

.log-entry.warning {
    background-color: rgba(251, 191, 36, 0.1);
}

.log-entry.error {
    background-color: rgba(220, 53, 69, 0.1);
}

.log-entry.debug {
    background-color: rgba(108, 117, 125, 0.1);
    color: var(--text-muted);
}

.log-timestamp {
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.log-level {
    color: var(--primary-color);
    font-weight: 600;
    min-width: 60px;
    text-transform: uppercase;
}

.log-level.warning {
    color: var(--warning-color, #fbbf24);
}

.log-level.error {
    color: var(--danger-color, #ff5c7a);
}

.log-message {
    color: var(--text-color);
    flex: 1;
    word-break: break-word;
}

/* Auto-scroll button states */
#auto-scroll-btn.active {
    background-color: var(--success-color, #34d399);
    border-color: var(--success-color, #34d399);
    color: white;
}

#auto-scroll-btn:not(.active) {
    opacity: 0.7;
}

/* Mobile responsive logs */
@media (max-width: 768px) {
    .logs-container {
        max-height: 50vh;
        min-height: 300px;
    }
    
    .log-entry {
        flex-wrap: wrap;
        font-size: 0.65rem;
    }
    
    .log-timestamp {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .logs-info-bar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .panel-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Log Sub-Tabs Mobile */
    .log-sub-tabs {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .log-sub-tab {
        flex: 1;
        min-width: 120px;
        justify-content: center;
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .log-sub-tab i {
        font-size: 0.9rem;
    }
    
    .log-count-badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .log-sub-tabs {
        flex-direction: column;
    }
    
    .log-sub-tab {
        width: 100%;
        min-width: unset;
        padding: 0.75rem;
    }
    
    .logs-panel .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .logs-panel .panel-header h2 {
        font-size: 1rem;
    }
    
    .logs-panel .panel-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .logs-panel .panel-actions .btn {
        flex: 1;
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .logs-panel .panel-actions .btn span,
    .logs-panel #auto-scroll-btn {
        font-size: 0.7rem;
    }
    
    .log-entry {
        padding: 0.4rem;
        font-size: 0.6rem;
    }
    
    .log-level {
        font-size: 0.6rem;
    }
}

/* Footer */
.footer {
    margin-top: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    background-color: var(--surface-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 8, 6, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden; /* Prevent background scrolling */
    touch-action: none; /* Prevent touch events on modal background */
}

.modal-content {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    max-width: 500px;
    width: 90%;
    max-height: 80%;
    overflow: hidden; /* Don't scroll the modal itself */
    touch-action: auto; /* Allow normal touch behavior within modal */
    display: flex;
    flex-direction: column; /* Stack header, body, footer */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1; /* Take up remaining space */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y; /* Only allow vertical scrolling */
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: var(--font-size-lg);
    font-weight: 500;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 1.1rem;
        justify-content: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
        gap: 12px;
    }
    
    .theme-toggle {
        padding: 8px 12px;
    }
    
    .status-indicator {
        font-size: 12px;
    }
    
    .panel-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 16px 20px;
    }
    
    .panel-header h2 {
        font-size: 1rem;
        justify-content: center;
    }
    
    .panel-actions {
        width: 100%;
        justify-content: center;
    }
    
    .panel-content {
        padding: 16px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-details {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Mobile scrolling fixes */
.modal-large .modal-body {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.report-content-container {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* Ensure all scrollable areas work on mobile */
.scrollable {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none; /* Prevent any touch scrolling on body */
}

/* Fix iOS Safari scrolling issues */
@supports (-webkit-touch-callout: none) {
    .modal-body,
    .report-text {
        -webkit-overflow-scrolling: touch !important;
        overflow-y: auto !important;
    }
    
    /* Prevent modal content from scrolling */
    .modal-content {
        overflow: hidden !important;
    }
    
    /* Ensure only the report text scrolls */
    .report-content-container {
        overflow: hidden !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for keyboard navigation */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.6);
    }
}

/* Tab Navigation Styles */
.tab-navigation {
    background: rgba(9, 19, 16, 0.88);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

[data-theme="light"] .tab-navigation {
    background: rgba(255, 255, 255, 0.9);
}

.tab-nav {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 4px;
}

.tab-button {
    background: transparent;
    border: none;
    padding: 16px 24px;
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.tab-button:hover {
    color: var(--accent-purple);
    background: rgba(54, 226, 170, 0.05);
}

.tab-button.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
    background: rgba(54, 226, 170, 0.1);
}

.tab-button i {
    font-size: 1rem;
}

/* Tab labels - default show full, hide short */
.tab-label-short {
    display: none;
}

.tab-label-full {
    display: inline;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Alert Sub-tabs */
.alerts-sub-tabs {
    display: flex;
    gap: 5px;
    background: var(--card-bg);
    padding: 8px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.sub-tab-button {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-size: var(--font-size-base);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex: 1;
    justify-content: center;
}

.sub-tab-button:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.sub-tab-button.active {
    color: var(--accent-primary);
    background: rgba(54, 226, 170, 0.12);
    font-weight: 600;
}

.sub-tab-button i {
    font-size: 14px;
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* Mobile adjustments for sub-tabs */
@media (max-width: 768px) {
    .alerts-sub-tabs {
        padding: 6px;
        gap: 3px;
    }

    .sub-tab-button {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .sub-tab-button {
        padding: 8px 12px;
        font-size: 12px;
        flex-direction: column;
        gap: 4px;
    }
    
    .sub-tab-button i {
        font-size: 16px;
    }
}

/* Status Indicator in Sub-tabs */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-left: auto;
    white-space: nowrap;
}

.status-indicator.stopped {
    background: rgba(255, 92, 122, 0.15);
    color: var(--danger-color);
}

.status-indicator.running {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success-color);
}

.status-indicator i {
    font-size: 8px;
    animation: none;
}

.status-indicator.running i {
    animation: pulse-status 1.5s ease-in-out infinite;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@media (max-width: 768px) {
    .status-indicator {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .status-indicator .status-text {
        display: none;
    }
}

/* Reports Panel Styles */
.reports-panel .panel-header {
    flex-wrap: wrap;
    gap: 15px;
}

.date-selector {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface-color);
    color: var(--text-color);
    font-size: var(--font-size-sm);
    min-width: 200px;
}

.date-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

/* ============================================
   SEARCH-FIRST UI - Hero Search Box
   ============================================ */
.search-hero {
    padding: 30px 20px;
    margin-bottom: 25px;
    text-align: center;
    background: linear-gradient(135deg, rgba(54, 226, 170, 0.1) 0%, rgba(56, 189, 248, 0.1) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
}

.search-hero-container {
    display: flex;
    align-items: center;
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    padding: 8px 8px 8px 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-hero-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(54, 226, 170, 0.15), 0 8px 30px rgba(0, 0, 0, 0.15);
}

.search-hero-icon {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-right: 12px;
}

.search-hero-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--text-color);
    outline: none;
    padding: 12px 0;
}

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

.search-hero-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 10px;
    margin-right: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.search-hero-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.search-hero-btn {
    background: var(--accent-primary);
    border: none;
    color: var(--text-on-accent);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-hero-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(54, 226, 170, 0.4);
}

.search-hint {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-hint .kbd {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Browse Mode Header */
.browse-mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.browse-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.browse-label i {
    margin-right: 8px;
}

/* Recent Reports Section */
.recent-reports-section {
    background: linear-gradient(135deg, rgba(54, 226, 170, 0.08), rgba(56, 189, 248, 0.05));
    border: 1px solid var(--border-accent);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    margin-bottom: 20px;
}

.recent-reports-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.recent-reports-header .section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.recent-reports-header .section-title i {
    color: var(--primary-color);
    margin-right: 8px;
}

.recent-reports-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.recent-reports-scroll::-webkit-scrollbar {
    height: 6px;
}

.recent-reports-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.recent-reports-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.recent-report-card {
    flex: 0 0 auto;
    min-width: 140px;
    max-width: 180px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recent-report-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(54, 226, 170, 0.2);
}

.recent-report-symbol {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-report-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.recent-report-time.fresh {
    color: var(--accent-green);
}

.recent-report-time.recent {
    color: var(--accent-cyan);
}

.recent-report-config {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(54, 226, 170, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tablet: adjust recent reports for medium screens */
@media (max-width: 768px) {
    .recent-reports-section {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .recent-reports-header {
        margin-bottom: 10px;
    }
    
    .recent-reports-header .section-title {
        font-size: 0.9rem;
    }
    
    .recent-report-card {
        min-width: 120px;
        max-width: 150px;
        padding: 10px;
        /* Improve touch targets */
        min-height: 44px;
    }
    
    .recent-report-symbol {
        font-size: 0.9rem;
    }
    
    .recent-report-time {
        font-size: 0.7rem;
    }
    
    .recent-report-config {
        font-size: 0.6rem;
    }
}

/* Mobile: stack recent reports vertically */
@media (max-width: 480px) {
    .recent-reports-section {
        padding: 10px;
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    .recent-reports-header {
        margin-bottom: 8px;
    }
    
    .recent-reports-header .section-title {
        font-size: 0.85rem;
    }
    
    #refresh-recent-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .recent-reports-scroll {
        flex-direction: column;
        overflow-x: visible;
        gap: 8px;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .recent-report-card {
        min-width: 100%;
        max-width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        /* Touch-friendly tap target */
        min-height: 48px;
    }
    
    .recent-report-card:hover {
        transform: none; /* Disable lift on mobile - causes issues */
    }
    
    .recent-report-card:active {
        background: rgba(54, 226, 170, 0.15);
        border-color: var(--primary-color);
    }
    
    .recent-report-symbol {
        flex: 1;
        font-size: 0.95rem;
    }
    
    .recent-report-time {
        flex: 0 0 auto;
        font-size: 0.75rem;
        padding-left: 10px;
    }
    
    .recent-report-config {
        display: none;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .recent-reports-section {
        padding: 8px;
    }
    
    .recent-reports-header .section-title {
        font-size: 0.8rem;
    }
    
    .recent-report-card {
        padding: 10px;
    }
    
    .recent-report-symbol {
        font-size: 0.9rem;
    }
}

/* Recent reports loading/empty states */
.recent-reports-scroll .loading-message,
.recent-reports-scroll .empty-message,
.recent-reports-scroll .error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    width: 100%;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.recent-reports-scroll .error-message {
    color: var(--accent-red);
}

.recent-reports-scroll .loading-message i {
    animation: spin 1s linear infinite;
}

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

/* Search Results Header Bar */
.search-results-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.search-results-active {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
}

/* Collapsible Sections */
.collapsible-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 15px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.collapsible-header:hover {
    background: rgba(54, 226, 170, 0.05);
}

.collapsible-header .section-title {
    margin: 0;
    font-size: 1rem;
}

.collapsible-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-toggle-icon {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.collapsible-section.expanded .section-toggle-icon,
.collapsible-content:not(.collapsed) + .section-toggle-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    padding: 0 20px 20px 20px;
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.collapsible-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Info Banner - Collapsible by default */
.info-banner.collapsed .info-banner-content {
    max-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.info-banner .info-banner-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-banner .info-toggle-icon {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.info-banner:not(.collapsed) .info-toggle-icon {
    transform: rotate(180deg);
}

/* Hide browse sections when showing search results */
.search-results-section:not([style*="display: none"]) ~ #reports-content {
    display: none;
}

/* Legacy Search Section (keep for compatibility) */
.search-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.search-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    background: var(--bg-color);
    color: var(--text-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.search-btn, .clear-search-btn {
    padding: 10px 15px;
    border: 1px solid var(--accent-primary);
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.search-btn:hover, .clear-search-btn:hover {
    background: var(--accent-primary-dark);
    border-color: var(--accent-primary-dark);
}

.clear-search-btn {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: #fff;
}

/* Info Banner Styles */
.info-banner {
    background: linear-gradient(135deg, #36e2aa 0%, #2bd4c2 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.info-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.info-banner-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.25);
    position: relative;
    z-index: 1;
}

.info-banner-header i {
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.info-banner-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    position: relative;
    z-index: 1;
}

.info-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.15);
    padding: 18px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.info-item > i {
    font-size: 1.4rem;
    margin-top: 2px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.info-item > div {
    flex: 1;
}

.info-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.info-item p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    opacity: 0.95;
}

.info-item .run-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0 3px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Configuration Parameter Badges */
.config-params {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    align-items: center;
}

.param-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--surface-color), var(--bg-color));
    border: 1px solid var(--border-color);
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.param-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.param-badge i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.param-mcap {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.35);
    color: var(--accent-blue);
}

.param-price {
    background: rgba(255, 92, 122, 0.14);
    border-color: rgba(255, 92, 122, 0.35);
    color: var(--danger-color);
}

.param-volume {
    background: rgba(34, 211, 238, 0.14);
    border-color: rgba(34, 211, 238, 0.35);
    color: var(--accent-cyan);
}

.param-ratio {
    background: rgba(54, 226, 170, 0.14);
    border-color: rgba(54, 226, 170, 0.35);
    color: var(--accent-primary);
}

.param-days {
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.35);
    color: var(--warning-color);
}

@media (max-width: 992px) {
    .info-banner-content {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .info-banner-content {
        grid-template-columns: 1fr;
    }
    
    .info-banner {
        padding: 20px;
        border-radius: 10px;
    }
    
    .info-banner-header {
        font-size: 1.1rem;
    }
    
    .info-item {
        padding: 15px;
    }
    
    .info-item > i {
        font-size: 1.2rem;
        width: 36px;
        height: 36px;
        padding: 8px;
    }
    
    .info-item strong {
        font-size: 0.95rem;
    }
    
    .info-item p {
        font-size: 0.88rem;
    }
}

.clear-search-btn:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
}

/* Reports Sections */
.reports-section {
    margin-bottom: 30px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-lg);
    color: var(--text-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Report Cards - Performance Optimized */
.report-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    cursor: pointer;
    /* Performance: Only transition specific properties, not "all" */
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow);
    /* Performance: Content visibility for off-screen cards (prevents rendering) */
    content-visibility: auto;
    contain-intrinsic-size: auto 180px; /* Estimated card height for layout stability */
    /* Performance: Hint GPU compositing for transforms */
    will-change: transform;
    /* Performance: Isolate paint and layout */
    contain: layout style paint;
}

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

/* Disable hover animations during scroll for better performance */
.is-scrolling .report-card {
    transition: none !important;
    will-change: auto;
}

.is-scrolling .report-card:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.report-card .config-params {
    margin: 15px 0 10px 0;
    gap: 6px;
}

.report-card .param-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
}

.report-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.report-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-color);
}

.report-type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.report-type-badge.summary {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

.report-type-badge.individual {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.report-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.report-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.report-preview {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.4;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

.report-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.report-screenshot-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--success-color);
    font-size: var(--font-size-sm);
}

.report-screenshot-thumb {
    width: 40px;
    height: 25px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* Loading and Empty States */
.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-muted);
    font-size: var(--font-size-base);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-content {
    max-width: 400px;
    margin: 0 auto;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-muted);
    line-height: 1.5;
}

/* Report Viewer Modal */
.modal-large {
    max-width: 90vw;
    width: 1200px;
    max-height: 90vh;
}

.report-viewer {
    display: flex;
    gap: 20px;
    height: 70vh;
    overflow: hidden; /* Prevent the viewer itself from scrolling */
}

.report-content-container {
    flex: 1;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.report-text {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-color);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    color: var(--text-color);
    -webkit-overflow-scrolling: touch; /* Enable smooth scrolling on iOS */
    touch-action: pan-y; /* Allow vertical scrolling */
}

.report-screenshot-container {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface-color);
}

.screenshot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.screenshot-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: var(--font-size-base);
    color: var(--text-color);
}

.screenshot-expand-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.screenshot-expand-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.screenshot-content {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.report-screenshot {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.report-screenshot:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

.screenshot-caption {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-align: center;
}

/* Screenshot Fullscreen Modal */
.screenshot-modal {
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
}

.screenshot-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screenshot-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2001;
    transition: var(--transition);
}

.screenshot-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fullscreen-screenshot {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
}

/* Search Results - Performance Optimized */
.search-result-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    cursor: pointer;
    /* Performance: Only transition specific properties */
    transition: background-color 0.2s ease, border-color 0.2s ease;
    /* Performance: Content visibility for off-screen items */
    content-visibility: auto;
    contain-intrinsic-size: auto 80px;
}

.search-result-item:hover {
    background: rgba(0, 123, 255, 0.05);
    border-color: var(--primary-color);
}

/* Disable hover during scroll */
.is-scrolling .search-result-item {
    transition: none !important;
}

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

.search-result-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.search-result-date {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.search-result-match {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: 1.4;
}

.search-highlight {
    background: rgba(251, 191, 36, 0.3);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Search Results Header */
.search-results-header {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Match Quality Indicators */
.search-result-item.exact-match {
    border-left: 3px solid #34d399;
}

.search-result-item.good-match {
    border-left: 3px solid #22d3ee;
}

.search-result-item.partial-match {
    border-left: 3px solid #fbbf24;
}

.search-result-item.fuzzy-match {
    border-left: 3px solid #6c757d;
}

.search-result-title i.fa-check-circle {
    color: #34d399;
    font-size: 12px;
}

.search-result-title i.fa-check {
    color: #22d3ee;
    font-size: 12px;
}

.search-result-title i.fa-minus-circle {
    color: #fbbf24;
    font-size: 12px;
}

.search-result-title i.fa-question-circle {
    color: #6c757d;
    font-size: 12px;
}

.search-result-match .match-type {
    font-weight: 600;
    color: var(--text-color);
}

.search-result-config {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.search-result-config i {
    margin-right: 5px;
    opacity: 0.7;
}

/* Enhanced Responsive Design for Reports */
@media (max-width: 768px) {
    .container {
        padding: 0 5px;
    }
    
    /* Mobile Tab Navigation - Grid Layout */
    .tab-navigation {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .tab-nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 0;
        overflow-x: visible;
        max-width: 100%;
    }
    
    .tab-button {
        flex-direction: column;
        padding: 10px 6px;
        font-size: 10px;
        gap: 4px;
        border-radius: 8px;
        border-bottom: none;
        background: var(--bg-tertiary);
        min-height: 56px;
        justify-content: center;
    }
    
    .tab-button i {
        font-size: 18px;
    }
    
    .tab-button.active {
        background: rgba(54, 226, 170, 0.2);
        border-bottom: none;
        box-shadow: 0 0 0 2px var(--accent-purple);
    }
    
    .tab-button:hover {
        background: rgba(54, 226, 170, 0.15);
    }
    
    /* Show short labels, hide full labels on mobile */
    .tab-label-full {
        display: none;
    }
    
    .tab-label-short {
        display: inline;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-input-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-btn, .clear-search-btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
    }
    
    .modal-large {
        width: calc(100% - 10px);
        max-width: none;
        max-height: 95vh;
        margin: 5px;
    }
    
    .report-viewer {
        flex-direction: column;
        height: auto;
        max-height: 75vh;
        gap: 15px;
    }
    
    .report-content-container {
        order: 2;
        flex: 1;
        min-height: 300px;
    }
    
    .report-text {
        font-size: 14px;
        line-height: 1.6;
        padding: 15px;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        overflow-y: auto;
        max-height: 50vh; /* Ensure it has a defined height for scrolling */
    }
    
    .report-screenshot-container {
        order: 1;
        flex: none;
        max-height: 250px;
    }
    
    .date-selector {
        width: 100%;
        min-width: auto;
        padding: 12px;
        font-size: 16px;
    }
    
    /* Mobile-optimized report cards */
    .report-card {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .report-title {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .report-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .report-meta-item {
        font-size: 14px;
    }
    
    .report-preview {
        font-size: 14px;
        line-height: 1.5;
        -webkit-line-clamp: 4;
    }
    
    /* Better touch targets for mobile */
    .btn {
        min-height: 44px;
        font-size: 16px;
    }
    
    .panel-header {
        padding: 15px;
    }
    
    .panel-content {
        padding: 15px;
    }
}

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 92, 122, 0.3);
    transition: var(--transition);
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 92, 122, 0.4);
}

.btn-danger:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-warning {
    background: var(--accent-orange);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
    transition: var(--transition);
}

.btn-warning:hover:not(:disabled) {
    background: var(--warning-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

/* Status Indicators for Stop States */
.status-dot.stopped {
    background-color: #fbbf24;
    animation: none;
}

/* Configuration-based report organization */
.config-group {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

.config-group h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 1.1em;
}

.config-stats {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.config-actions {
    display: flex;
    gap: 10px;
}

.config-reports-view {
    max-width: 100%;
}

.config-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.config-header h3 {
    margin: 0;
    color: #495057;
}

.reports-list {
    display: grid;
    gap: 15px;
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    transition: box-shadow 0.2s ease;
}

.report-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.report-info {
    flex: 1;
}

.report-info h5 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 1.1em;
}

.report-preview {
    color: #6c757d;
    font-size: 0.9em;
    margin: 8px 0;
    line-height: 1.4;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

.report-meta {
    color: #868e96;
    font-size: 0.8em;
}

.report-actions {
    flex-shrink: 0;
    margin-left: 15px;
}

/* Market Cap Sections */
.market-cap-section {
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.market-cap-header {
    background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 100%);
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
}

.market-cap-header h5 {
    margin: 0;
    color: #495057;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-cap-header .token-count {
    color: #6c757d;
    font-weight: normal;
    font-size: 0.9em;
}

.market-cap-reports {
    padding: 15px;
    display: grid;
    gap: 12px;
}

.report-market-cap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 6px;
    color: #495057;
}

.summary-reports-section {
    margin-bottom: 20px;
}

/* Market cap range colors and styling */
.market-cap-section[data-range="1B+"] .market-cap-header {
    background: linear-gradient(90deg, rgba(31, 119, 180, 0.1) 0%, #ffffff 100%);
}

.market-cap-section[data-range="100M-1B"] .market-cap-header {
    background: linear-gradient(90deg, rgba(255, 127, 14, 0.1) 0%, #ffffff 100%);
}

.market-cap-section[data-range="10M-100M"] .market-cap-header {
    background: linear-gradient(90deg, rgba(44, 160, 44, 0.1) 0%, #ffffff 100%);
}

.market-cap-section[data-range="1M-10M"] .market-cap-header {
    background: linear-gradient(90deg, rgba(214, 39, 40, 0.1) 0%, #ffffff 100%);
}

.market-cap-section[data-range="Under1M"] .market-cap-header {
    background: linear-gradient(90deg, rgba(148, 103, 189, 0.1) 0%, #ffffff 100%);
}

.market-cap-section[data-range="unknown"] .market-cap-header {
    background: linear-gradient(90deg, rgba(108, 117, 125, 0.1) 0%, #ffffff 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .market-cap-reports {
        padding: 10px;
        gap: 10px;
    }
    
    .market-cap-header {
        padding: 10px 12px;
    }
    
    .market-cap-header h5 {
        font-size: 1em;
    }
}

.status-dot.stopping {
    background-color: #fd7e14;
    animation: pulse 1.5s infinite;
}

@media (max-width: 768px) {
    .control-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .control-buttons .btn {
        width: 100%;
    }
}

/* Market Cap Folders Styles */
.market-cap-folders {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.market-cap-folder {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.market-cap-folder:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    cursor: pointer;
    user-select: none;
}

.folder-header.custom-color {
    background: linear-gradient(135deg, var(--folder-color), var(--folder-color-dark));
}

.folder-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.folder-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.folder-toggle {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.folder-toggle.expanded {
    transform: rotate(90deg);
}

.folder-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.folder-content.expanded {
    max-height: 2000px;
    padding: 1rem;
}

.folder-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.folder-report-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition);
    cursor: pointer;
}

.folder-report-card:hover {
    background: var(--surface-color);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.folder-report-card .config-params {
    margin: 10px 0 0 0;
    gap: 6px;
}

.folder-report-card .param-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
}

.report-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.report-symbol {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--primary-color);
}

.report-market-cap {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.report-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* New Listing Badge Styles */
.new-listing-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    margin-left: 8px;
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #1a1a1a;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    animation: shimmer 2s ease-in-out infinite;
    vertical-align: middle;
}

.new-listing-badge.summary-badge {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.4);
}

@keyframes shimmer {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 2px 16px rgba(255, 215, 0, 0.7);
    }
}

.new-listing-card {
    border-left: 4px solid #ffd700 !important;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.08), transparent 30%) !important;
}

.new-listing-card:hover {
    border-left-color: #ffb700 !important;
}

/* New Listings Section Styles */
.new-listings-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(255, 183, 0, 0.02));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.new-listings-section .section-title {
    color: #ffd700;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.new-listings-title {
    color: #ffd700 !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.new-listings-badge-count {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #1a1a1a;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 8px;
}

.new-listings-header {
    margin-bottom: 15px;
}

.section-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 5px 0 0 0;
    padding-left: 0;
}

/* New listings reports grid - matches main reports grid */
.new-listings-section .reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

/* Style report cards in new listings section */
.new-listings-section .report-card {
    background: var(--surface-color, #fff);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-left: 4px solid #ffd700;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
    overflow: hidden;
    min-width: 0;
}

.new-listings-section .report-card:hover {
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
    border-color: #ffd700;
}

.new-listings-section .report-info {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.new-listings-section .report-info h5 {
    margin: 0 0 8px 0;
    color: var(--text-color, #333);
    font-size: 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.new-listings-section .report-preview {
    color: var(--text-muted, #666);
    font-size: 0.85rem;
    margin: 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

.new-listings-section .report-meta {
    font-size: 0.75rem;
    color: var(--text-muted, #888);
}

.new-listings-section .report-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.new-listings-config-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 183, 0, 0.03));
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.new-listings-config-section h4 {
    color: #ffd700;
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-listings-config-section .count-badge {
    background: linear-gradient(135deg, #ffd700, #ffb700);
    color: #1a1a1a;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.new-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* Mobile responsiveness for new listings */
@media (max-width: 768px) {
    .new-listings-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .new-listings-section .reports-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .new-listings-section .report-card {
        padding: 12px;
    }
    
    .new-listings-section .report-info h5 {
        font-size: 0.95rem;
    }
    
    .new-listings-section .report-preview {
        font-size: 0.8rem;
        -webkit-line-clamp: 3;
    }
    
    .new-listings-title {
        font-size: 1.1rem;
    }
    
    .new-listings-badge-count {
        padding: 3px 8px;
        font-size: 0.75rem;
    }
    
    .section-description {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .new-listings-section {
        padding: 12px;
        border-radius: 8px;
    }
    
    .new-listings-section .report-card {
        padding: 10px;
    }
    
    .new-listings-section .report-actions .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Summary Parameters Styles */
.summary-parameters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.param-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--text-color);
    font-weight: 500;
}

.param-item i {
    color: var(--primary-color);
    width: 14px;
    text-align: center;
}

/* Mobile-specific optimizations for very small screens */
@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    
    .header-content {
        padding: 0.75rem 0;
        gap: 10px;
    }
    
    .header h1 {
        font-size: 0.95rem;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .theme-toggle {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .theme-toggle i {
        font-size: 14px;
    }
    
    .status-indicator {
        font-size: 11px;
        gap: 4px;
    }
    
    .status-dot {
        width: 10px;
        height: 10px;
    }
    
    /* Mobile Tab Navigation - Smaller phones */
    .tab-nav {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    
    .tab-button {
        padding: 8px 4px;
        font-size: 9px;
        min-height: 52px;
    }
    
    .tab-button i {
        font-size: 16px;
    }
    
    .panel {
        margin-bottom: 16px;
        border-radius: var(--radius-lg);
    }
    
    .panel-header {
        padding: 14px;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .panel-header h2 {
        font-size: 0.95rem;
    }
    
    .panel-content {
        padding: 14px;
    }
    
    .btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .report-card {
        padding: 12px;
    }
    
    .report-title {
        font-size: 16px;
    }
    
    .report-preview {
        font-size: 13px;
        -webkit-line-clamp: 3;
    }
    
    .modal-content {
        width: calc(100% - 10px);
        margin: 5px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-header {
        padding: 12px;
    }
    
    .modal-body {
        padding: 12px;
    }
    
    .report-text {
        font-size: 13px;
        line-height: 1.5;
        padding: 12px;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        overflow-y: auto;
        max-height: 40vh; /* Smaller height for very small screens */
        position: relative; /* Ensure proper positioning */
    }
    
    /* Improve form readability on mobile */
    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    /* Better spacing for mobile */
    .main-content {
        padding: 1rem 0;
        gap: 1rem;
    }
}

/* Responsive design for market cap folders */
@media (max-width: 768px) {
    .folder-reports-grid {
        grid-template-columns: 1fr;
    }
    
    .folder-header {
        padding: 0.75rem 1rem;
    }
    
    .folder-title {
        font-size: var(--font-size-base);
        gap: 0.5rem;
    }
    
    .summary-parameters {
        grid-template-columns: 1fr;
    }
    
    .folder-report-card {
        padding: 12px;
    }
    
    .report-symbol {
        font-size: 16px;
    }
    
    .report-market-cap {
        font-size: 12px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .report-viewer {
        flex-direction: row;
        max-height: 85vh;
    }
    
    .report-content-container {
        order: 1;
        flex: 2;
    }
    
    .report-screenshot-container {
        order: 2;
        flex: 0 0 250px;
        max-height: none;
    }
}

/* ============================================================================
   SCHEDULER STYLES
   ============================================================================ */

.scheduler-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.status-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
}

.status-card:hover {
    box-shadow: var(--shadow);
}

.status-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-color);
}

.status-value.running {
    color: var(--success-color);
}

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

.scheduler-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.scheduler-controls .btn {
    min-width: 140px;
}

/* Scheduler configuration form styles */
.scheduler-config-panel .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.scheduler-config-panel .form-group {
    display: flex;
    flex-direction: column;
}

.scheduler-config-panel .form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.scheduler-config-panel .form-group label input[type="checkbox"] {
    margin-right: 0.5rem;
    margin-bottom: 0;
}

.scheduler-config-panel .form-control {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
    color: var(--text-color);
    font-size: var(--font-size-base);
    transition: var(--transition);
}

.scheduler-config-panel .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.scheduler-config-panel .form-help {
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Responsive scheduler styles */
@media (max-width: 768px) {
    .scheduler-status-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .status-card {
        padding: 0.75rem;
    }
    
    .status-value {
        font-size: var(--font-size-base);
    }
    
    .scheduler-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .scheduler-controls .btn {
        min-width: unset;
        width: 100%;
    }
    
    .scheduler-config-panel .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ============================================================================
   BRIDGE ANALYTICS DASHBOARD STYLES
   ============================================================================ */

/* Timeframe Selector */
.timeframe-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-color);
    padding: 0.25rem;
    border-radius: var(--border-radius);
}

.timeframe-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeframe-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.timeframe-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

/* Loading and Error States */
.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.loading-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.error-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--danger-color);
}

.loading-small {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* Summary Stats */
.bridge-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--bg-color) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-icon {
    font-size: 2rem;
    color: var(--primary-color);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 123, 255, 0.1);
    border-radius: var(--border-radius);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-color);
}

/* Bridge Highlights */
.bridge-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.highlight-section h3 {
    font-size: var(--font-size-lg);
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.highlight-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.highlight-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.highlight-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateX(4px);
}

.highlight-card.gainer {
    border-left: 4px solid var(--success-color);
}

.highlight-card.loser {
    border-left: 4px solid var(--danger-color);
}

.highlight-rank {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-muted);
    width: 40px;
    text-align: center;
}

.highlight-content {
    flex: 1;
}

.highlight-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.highlight-chains {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.highlight-volume {
    font-size: var(--font-size-sm);
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.highlight-change {
    font-size: var(--font-size-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.highlight-change.positive {
    color: var(--success-color);
}

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

/* Bridge Search Section */
.bridge-search-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: var(--border-radius-lg);
}

.bridge-search-section h3 {
    font-size: var(--font-size-lg);
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bridge-search-results {
    margin-top: 1rem;
}

.search-results-header {
    padding: 0.75rem;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-result-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.search-result-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.search-result-change {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.search-result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.search-result-details div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-no-results,
.search-error {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.search-no-results i,
.search-error i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Bridge Table */
.bridge-table-section {
    margin: 2rem 0;
}

.bridge-table-section h3 {
    font-size: var(--font-size-lg);
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.count-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.bridge-table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    background: var(--surface-color);
}

.bridges-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.bridges-table thead {
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.bridges-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.bridges-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.bridges-table th.sortable:hover {
    background: var(--surface-color);
    color: var(--primary-color);
}

.bridges-table th i {
    margin-left: 0.25rem;
    font-size: 0.875rem;
}

.bridges-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.bridges-table tbody tr {
    transition: var(--transition);
}

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

.bridge-name {
    font-weight: 600;
}

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

.bridge-volume {
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.bridge-change {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bridge-change.positive {
    color: var(--success-color);
}

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

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

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

.btn-view-details {
    padding: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-view-details:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Last Updated */
.last-updated {
    margin-top: 2rem;
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.last-updated i {
    margin-right: 0.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .timeframe-selector {
        flex-direction: column;
    }
    
    .timeframe-btn {
        width: 100%;
        justify-content: center;
    }
    
    .bridge-summary-stats {
        grid-template-columns: 1fr;
    }
    
    .bridge-highlights {
        grid-template-columns: 1fr;
    }
    
    .highlight-card {
        padding: 0.75rem;
    }
    
    .highlight-rank {
        width: 30px;
        font-size: var(--font-size-lg);
    }
    
    .bridge-search-section {
        padding: 1rem;
    }
    
    .search-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .bridge-table-container {
        /* Enable horizontal scrolling on mobile */
        -webkit-overflow-scrolling: touch;
    }
    
    .bridges-table {
        min-width: 600px; /* Ensure table doesn't collapse too much */
    }
    
    .bridges-table th,
    .bridges-table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Make first column sticky on mobile */
    .bridges-table th:first-child,
    .bridges-table td:first-child {
        position: sticky;
        left: 0;
        background: var(--surface-color);
        z-index: 5;
    }
    
    .bridges-table thead th:first-child {
        z-index: 15;
        background: var(--bg-color);
    }
}

/* Tablet Responsiveness */
@media (min-width: 768px) and (max-width: 1024px) {
    .bridge-summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bridge-highlights {
        grid-template-columns: 1fr;
    }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
    .timeframe-btn,
    .btn-view-details,
    .bridges-table th.sortable {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================
   ALERTS TAB STYLES
   ============================================ */

.alerts-panel {
    background: var(--surface-color);
}

.alerts-panel .section-description {
    margin-bottom: 20px;
    padding: 12px 15px;
    background: rgba(56, 189, 248, 0.1);
    border-left: 4px solid #38bdf8;
    border-radius: 4px;
    color: var(--text-color);
}

.alerts-panel .config-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.alerts-panel .config-section h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.alerts-panel .config-section h3 i {
    color: #38bdf8;
}

.alerts-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.alerts-controls .btn {
    min-width: 140px;
}

/* Telegram Validation */
.validation-result {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-left: 10px;
}

.validation-result.success {
    background: rgba(61, 220, 151, 0.1);
    color: #3ddc97;
}

.validation-result.error {
    background: rgba(255, 92, 122, 0.1);
    color: #ff5c7a;
}

/* Alert Status Panel */
.alert-status-panel {
    margin-top: 20px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.status-item {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.status-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

.status-value.running {
    color: #3ddc97;
}

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

/* Recent Alerts Section */
.recent-alerts-section {
    margin-top: 20px;
}

.recent-alerts-section h3 {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-alerts-list {
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.no-alerts-message {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}

.alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

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

.alert-item:hover {
    background: rgba(56, 189, 248, 0.05);
}

.alert-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-type-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.alert-type-badge.price {
    background: rgba(61, 220, 151, 0.1);
    color: #3ddc97;
}

.alert-type-badge.volume {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

.alert-token-name {
    font-weight: 600;
    color: var(--text-color);
}

.alert-change {
    color: #3ddc97;
    font-weight: 500;
}

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

/* Status Badge in Header */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.status-running {
    background: rgba(61, 220, 151, 0.1);
    color: #3ddc97;
}

.status-badge.status-stopped {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.status-badge i {
    font-size: 0.6rem;
}

/* Info Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.info-box i {
    color: #38bdf8;
    margin-top: 2px;
}

.info-box strong {
    color: var(--text-color);
}

/* Active Filters Display */
.active-filters-display {
    margin-top: 20px;
    padding: 15px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
}

.active-filters-display h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface-color);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.filter-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.filter-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.active-filters-display .help-text {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.active-filters-display .help-text i {
    color: #38bdf8;
}

/* Custom Filters Section (for alerts) */
.custom-filters-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 8px;
}

.custom-filters-section h4 {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    color: #34d399;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-filters-section .form-grid {
    margin-bottom: 0;
}

.custom-filters-section .info-box {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.3);
}

/* Alerts Mobile Responsiveness */
@media (max-width: 768px) {
    .alerts-panel .config-section {
        padding: 15px;
    }
    
    .alerts-controls {
        flex-direction: column;
    }
    
    .alerts-controls .btn {
        width: 100%;
    }
    
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .validation-result {
        display: block;
        margin: 10px 0 0 0;
    }
    
    .alert-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .alert-time {
        align-self: flex-end;
    }
    
    .filter-values {
        grid-template-columns: 1fr;
    }
    
    .filter-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ========== Outcome Analytics Styles ========== */

.outcome-analytics-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.outcome-analytics-panel .panel-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.outcome-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.outcome-card {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.outcome-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.outcome-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.outcome-value.positive {
    color: #34d399;
}

.outcome-value.negative {
    color: #ff5c7a;
}

.outcome-sample {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Threshold Table */
.threshold-analysis .data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.threshold-analysis .data-table th,
.threshold-analysis .data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.threshold-analysis .data-table th {
    background: rgba(0, 0, 0, 0.1);
    font-weight: 600;
    font-size: 0.85rem;
}

.threshold-analysis .data-table td.positive {
    color: #34d399;
}

.threshold-analysis .data-table td.negative {
    color: #ff5c7a;
}

.threshold-analysis .data-table td.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* Performers Section */
.performers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.performers-column h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.performers-list {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px;
}

.performer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.performer-symbol {
    font-weight: 600;
    min-width: 60px;
}

.performer-return {
    font-weight: 700;
}

.performer-return.positive {
    color: #34d399;
}

.performer-return.negative {
    color: #ff5c7a;
}

.performer-threshold {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.no-data {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 10px;
}

/* Outcome Analytics Mobile */
@media (max-width: 768px) {
    .outcome-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .performers-grid {
        grid-template-columns: 1fr;
    }
    
    .outcome-analytics-panel .panel-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .outcome-analytics-panel .panel-actions {
        flex-wrap: wrap;
    }
    
    .threshold-analysis {
        overflow-x: auto;
    }
    
    .threshold-analysis .data-table {
        min-width: 600px;
    }
}

/* ========== Repeat Performer Analytics Styles ========== */

/* Featured Panel Styling */
.featured-panel {
    border: 1px solid rgba(255, 152, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.03) 0%, transparent 100%);
}

.featured-panel .panel-header {
    border-bottom: 1px solid rgba(255, 152, 0, 0.2);
}

.panel-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.panel-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Hero Stats Row */
.repeat-hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-stat.repeat-highlight {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15) 0%, rgba(255, 152, 0, 0.05) 100%);
    border-color: rgba(255, 152, 0, 0.3);
}

.hero-stat.win-stat .hero-value {
    color: #34d399;
}

.hero-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.hero-stat.repeat-highlight .hero-icon {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

.hero-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hero-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

.hero-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Comparison Section */
.comparison-section {
    margin-top: 8px;
}

.comparison-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.repeat-performer-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.comparison-card {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comparison-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.comparison-card.repeat-card {
    border-color: rgba(255, 152, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.08) 0%, rgba(255, 152, 0, 0.02) 100%);
}

.comparison-card.single-card {
    border-color: rgba(158, 158, 158, 0.3);
    background: rgba(158, 158, 158, 0.05);
}

.comparison-card .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comparison-card .card-icon {
    font-size: 1.3rem;
}

.comparison-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    flex-grow: 1;
}

.comparison-card .card-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-card .card-badge.muted {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

.comparison-card .card-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.comparison-card .card-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.comparison-card .stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.comparison-card .stat-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.comparison-card .stat-value.positive {
    color: #34d399;
}

.comparison-card .stat-value.negative {
    color: #ff5c7a;
}

/* Difference Summary */
.difference-summary {
    margin-top: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1) 0%, rgba(0, 123, 255, 0.03) 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 123, 255, 0.2);
}

.difference-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.difference-header i {
    color: #fbbf24;
    font-size: 1.1rem;
}

.difference-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.difference-summary p {
    margin: 6px 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Repeat Details Section */
.repeat-details-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.repeat-details-section .section-header h3 {
    margin: 0;
    font-size: 1rem;
}

.repeat-details-section .sort-hint {
    margin: 0;
    font-size: 0.8rem;
}

.difference-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.difference-item .diff-label {
    flex: 1;
}

.difference-item .diff-value {
    font-weight: 700;
}

.difference-item .diff-value.better {
    color: #34d399;
}

.difference-item .diff-value.worse {
    color: #ff5c7a;
}

/* Repeat Performers Table */
.repeat-details-section .data-table {
    width: 100%;
    margin-top: 15px;
}

.repeat-details-section .data-table th,
.repeat-details-section .data-table td {
    padding: 10px 12px;
    text-align: left;
}

.repeat-details-section .data-table th {
    background: rgba(0, 0, 0, 0.1);
    font-weight: 600;
    font-size: 0.85rem;
}

/* Sortable table headers */
.sortable-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.sortable-table th.sortable:hover {
    background: rgba(0, 0, 0, 0.2);
}

.sortable-table th.sortable i {
    margin-left: 5px;
    opacity: 0.5;
    font-size: 0.8em;
}

.sortable-table th.sortable.sort-asc i,
.sortable-table th.sortable.sort-desc i {
    opacity: 1;
    color: var(--primary-color);
}

.sortable-table th.sortable.sort-asc i::before {
    content: "\f0de"; /* fa-sort-up */
}

.sortable-table th.sortable.sort-desc i::before {
    content: "\f0dd"; /* fa-sort-down */
}

.repeat-details-section .data-table td.positive {
    color: #34d399;
}

.repeat-details-section .data-table td.negative {
    color: #ff5c7a;
}

/* Report links in table */
.repeat-details-section .report-link {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.repeat-details-section .report-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.repeat-details-section .report-link i {
    font-size: 0.85em;
    opacity: 0.7;
}

.table-responsive {
    overflow-x: auto;
}

/* Mobile card view - default hidden */
.repeat-details-section .mobile-cards {
    display: none;
}

/* Mobile sort controls - hidden by default */
.mobile-sort-controls {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.mobile-sort-controls label {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.mobile-sort-controls select {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-size: 0.9rem;
}

.mobile-sort-controls .btn-small {
    padding: 8px 12px;
    min-width: auto;
}

.mobile-sort-controls .btn-small i {
    transition: transform 0.2s ease;
}

.mobile-sort-controls .btn-small.asc i {
    transform: rotate(180deg);
}

/* Repeat Performer Analytics Mobile */
@media (max-width: 768px) {
    /* Hero Stats responsive */
    .repeat-hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .hero-stat {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .hero-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .hero-value {
        font-size: 1.2rem;
    }
    
    .hero-label {
        font-size: 0.7rem;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .repeat-performer-panel .panel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .panel-title-group {
        text-align: center;
    }
    
    .repeat-details-section .section-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    /* Hide the desktop table on mobile */
    .repeat-details-section .table-responsive {
        display: none;
    }
    
    /* Show mobile card view */
    .repeat-details-section .mobile-cards {
        display: block !important;
    }
    
    /* Show mobile sort controls */
    .mobile-sort-controls {
        display: flex !important;
    }
    
    .comparison-card {
        padding: 15px;
    }
    
    .comparison-card .card-header {
        font-size: 1rem;
    }
    
    /* Make comparison cards use a 2-column grid for stats */
    .comparison-card .card-stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .comparison-card .card-stat {
        padding: 8px;
        background: rgba(0,0,0,0.1);
        border-radius: 6px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .comparison-card .stat-label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }
    
    .comparison-card .stat-value {
        font-size: 0.95rem;
    }
    
    .difference-summary {
        padding: 12px !important;
    }
    
    .difference-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .outcome-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .outcome-stats span {
        margin-left: 0 !important;
    }
    
    /* Threshold table mobile */
    .threshold-analysis .data-table {
        font-size: 0.75rem;
    }
    
    .threshold-analysis .data-table th,
    .threshold-analysis .data-table td {
        padding: 6px 4px;
    }
}

.mobile-performer-card {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-color);
}

.mobile-performer-card .card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-performer-card .token-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.mobile-performer-card .token-name a {
    color: var(--primary-color);
    text-decoration: none;
}

.mobile-performer-card .trigger-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.mobile-performer-card .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mobile-performer-card .stat-item {
    background: rgba(0,0,0,0.1);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
}

.mobile-performer-card .stat-item .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.mobile-performer-card .stat-item .value {
    font-size: 0.9rem;
    font-weight: 600;
}

.mobile-performer-card .stat-item .value.positive {
    color: #34d399;
}

.mobile-performer-card .stat-item .value.negative {
    color: #ff5c7a;
}

/* Desktop: show table, hide mobile cards and controls */
@media (min-width: 769px) {
    .repeat-details-section .table-responsive {
        display: block;
    }
    
    .repeat-details-section .mobile-cards {
        display: none !important;
    }
    
    .mobile-sort-controls {
        display: none !important;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    /* Hero Stats compact layout */
    .repeat-hero-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .hero-stat {
        flex-direction: column;
        text-align: center;
        padding: 12px 10px;
        gap: 8px;
    }
    
    .hero-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .hero-value {
        font-size: 1.1rem;
    }
    
    .hero-label {
        font-size: 0.65rem;
    }
    
    /* Comparison cards compact */
    .comparison-card {
        padding: 14px;
    }
    
    .comparison-card .card-header {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .comparison-card .card-title {
        font-size: 0.9rem;
    }
    
    .comparison-card .card-badge {
        font-size: 0.6rem;
        padding: 3px 8px;
    }
    
    .comparison-card .card-stat {
        padding: 8px 10px;
    }
    
    .comparison-card .stat-label {
        font-size: 0.7rem;
    }
    
    .comparison-card .stat-value {
        font-size: 0.85rem;
    }
    
    /* Difference summary compact */
    .difference-summary {
        padding: 12px 14px;
    }
    
    .difference-header h4 {
        font-size: 0.9rem;
    }
    
    .difference-summary p {
        font-size: 0.8rem;
    }
    
    .outcome-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .outcome-card {
        padding: 10px;
    }
    
    .outcome-label {
        font-size: 0.75rem;
    }
    
    .outcome-value {
        font-size: 1.1rem;
    }
    
    .outcome-sample {
        font-size: 0.65rem;
    }
    
    .mobile-performer-card .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .comparison-card .card-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Panel headers on small screens */
    .panel-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .panel-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .panel-actions .btn {
        flex: 1;
        min-width: 100px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    .panel-actions select {
        width: 100% !important;
    }
    
    /* Threshold table - make it scroll */
    #threshold-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .threshold-analysis .data-table {
        min-width: 500px;
    }
    
    /* Performers grid on mobile */
    .performers-grid {
        grid-template-columns: 1fr;
    }
    
    /* Help text */
    .help-text {
        font-size: 0.8rem;
    }
}

/* Ensure horizontal scroll indicator for tables on touch devices */
.table-responsive,
#threshold-table-container {
    position: relative;
}

@media (max-width: 768px) {
    .table-responsive::after,
    #threshold-table-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, var(--background-secondary));
        pointer-events: none;
        opacity: 0.5;
    }
    
    /* Hide sort text hint on mobile */
    .sort-hint {
        display: none;
    }
    
    /* Swipe hint for scrollable tables */
    .scroll-hint {
        display: block;
        font-size: 0.75rem;
        color: var(--text-muted);
        text-align: center;
        padding: 8px;
        margin-bottom: 5px;
    }
    
    .scroll-hint i {
        animation: swipe 1.5s ease-in-out infinite;
    }
    
    @keyframes swipe {
        0%, 100% { transform: translateX(-5px); opacity: 0.5; }
        50% { transform: translateX(5px); opacity: 1; }
    }
}

@media (min-width: 769px) {
    .scroll-hint {
        display: none;
    }
}

/* ===== Stage Badges for Repeat Performers ===== */
.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.stage-badge.stage-early {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.stage-badge.stage-growing {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.stage-badge.stage-mature {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.stage-badge.stage-exhausted {
    background: rgba(107, 107, 123, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(107, 107, 123, 0.3);
}

/* Score badges and cells for repeat performers table */
.score-cell {
    font-weight: 600;
    text-align: center;
}

.score-cell.score-high,
.score-badge.score-high {
    color: #34d399;
}

.score-cell.score-good,
.score-badge.score-good {
    color: #38bdf8;
}

.score-cell.score-moderate,
.score-badge.score-moderate {
    color: #fbbf24;
}

.score-cell.score-low,
.score-badge.score-low {
    color: #ff5c7a;
}

.score-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(54, 226, 170, 0.1);
    border: 1px solid rgba(54, 226, 170, 0.3);
}

.score-badge.score-high {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.3);
}

.score-badge.score-good {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

.score-badge.score-moderate {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.3);
}

.score-badge.score-low {
    background: rgba(255, 92, 122, 0.15);
    border-color: rgba(255, 92, 122, 0.3);
}

/* Table row styling by stage */
tr.stage-early td:first-child {
    border-left: 4px solid var(--accent-green);
}

tr.stage-growing td:first-child {
    border-left: 4px solid var(--accent-blue);
}

tr.stage-mature td:first-child {
    border-left: 4px solid var(--accent-orange);
}

tr.stage-exhausted {
    opacity: 0.75;
}

tr.stage-exhausted td:first-child {
    border-left: 4px solid var(--text-muted);
}

/* Days ago text */
.days-ago {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Stage Filter Controls */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.filter-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stage-filter-select {
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stage-filter-select:hover {
    border-color: var(--border-accent);
}

.stage-filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(54, 226, 170, 0.2);
}

/* Section header flex layout */
.repeat-details-section .section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.repeat-details-section .section-header h3 {
    margin-right: auto;
}

/* Mobile badges row */
.badges-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile performer card stage styling */
.mobile-performer-card.stage-early {
    border-left-color: var(--accent-green);
}

.mobile-performer-card.stage-growing {
    border-left-color: var(--accent-blue);
}

.mobile-performer-card.stage-mature {
    border-left-color: var(--accent-orange);
}

.mobile-performer-card.stage-exhausted {
    border-left-color: var(--text-muted);
    opacity: 0.8;
}

/* Light theme adjustments */
[data-theme="light"] .stage-filter-select {
    background: var(--bg-secondary);
}

/* Mobile responsive adjustments for stage features */
@media (max-width: 768px) {
    .filter-controls {
        width: 100%;
        justify-content: flex-start;
        margin-top: 10px;
    }
    
    .filter-controls label {
        font-size: 0.8rem;
    }
    
    .stage-filter-select {
        flex: 1;
        min-width: 120px;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .repeat-details-section .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .repeat-details-section .section-header h3 {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .repeat-details-section .sort-hint {
        display: none;
    }
    
    /* Stage badges on mobile */
    .stage-badge {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    
    /* Mobile card layout improvements */
    .mobile-performer-card .card-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .mobile-performer-card .badges-row {
        width: 100%;
        justify-content: space-between;
    }
    
    .mobile-performer-card .token-name {
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    /* Days ago on mobile */
    .days-ago {
        display: block;
        margin-top: 2px;
    }
}

@media (max-width: 480px) {
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .filter-controls label {
        margin-bottom: 0;
    }
    
    .stage-filter-select {
        width: 100%;
    }
    
    /* Even smaller badges on very small screens */
    .stage-badge {
        padding: 2px 6px;
        font-size: 0.65rem;
    }
    
    .mobile-performer-card .badges-row {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    /* Score badge in mobile cards */
    .mobile-performer-card .score-badge {
        padding: 2px 8px;
        font-size: 0.7rem;
        font-weight: 700;
    }
}

/* ============================================
   GLOBAL SCROLL PERFORMANCE OPTIMIZATIONS
   Prevents browser crashes during fast scrolling
   ============================================ */

/* During scroll: disable all non-essential animations */
.is-scrolling * {
    animation-play-state: paused !important;
}

/* During scroll: simplify backdrop-filter (very GPU intensive) */
.is-scrolling .header,
.is-scrolling .tab-navigation {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--bg-secondary) !important;
}

/* During scroll: disable box-shadow transitions on panels */
.is-scrolling .panel {
    transition: none !important;
}

/* GPU acceleration hint for scrollable containers */
.reports-grid,
.search-results-list,
#individual-reports-list,
#summary-reports-list,
#new-listings-reports-list {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ============================================
   SEARCH-FIRST UI - Mobile Responsiveness
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    /* Search Hero - More compact on tablet */
    .search-hero {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .search-hero-container {
        max-width: 100%;
        padding: 6px 6px 6px 15px;
    }
    
    .search-hero-input {
        font-size: 1rem;
        padding: 10px 0;
    }
    
    .search-hero-btn {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
    
    .search-hint {
        font-size: 0.8rem;
    }
    
    /* Browse Mode Header */
    .browse-mode-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    /* Collapsible Sections */
    .collapsible-header {
        padding: 12px 15px;
    }
    
    .collapsible-header .section-title {
        font-size: 0.9rem;
    }
    
    .collapsible-content {
        padding: 0 15px 15px 15px;
    }
    
    .collapsible-header-actions {
        gap: 8px;
    }
    
    .collapsible-header-actions .btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    /* Search Results */
    .search-results-active {
        padding: 15px;
    }
    
    .search-results-header-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    /* Info Banner collapsed state */
    .info-banner .info-banner-header {
        padding: 15px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    /* Search Hero - Compact mobile design */
    .search-hero {
        padding: 15px 10px;
        margin-bottom: 15px;
        border-radius: var(--border-radius);
    }
    
    .search-hero-container {
        padding: 4px 4px 4px 12px;
        border-radius: 30px;
    }
    
    .search-hero-icon {
        font-size: 1rem;
        margin-right: 8px;
    }
    
    .search-hero-input {
        font-size: 0.95rem;
        padding: 8px 0;
    }
    
    .search-hero-input::placeholder {
        font-size: 0.85rem;
    }
    
    .search-hero-btn {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
    
    .search-hero-clear {
        padding: 8px;
    }
    
    /* Hide keyboard hint on mobile (no keyboard shortcuts) */
    .search-hint {
        display: none;
    }
    
    /* Browse Mode Header - Stack vertically */
    .browse-mode-header {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    
    .browse-label {
        font-size: 0.9rem;
    }
    
    /* Collapsible Sections - Tighter spacing */
    .collapsible-section {
        margin-bottom: 10px;
        border-radius: var(--border-radius);
    }
    
    .collapsible-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .collapsible-header .section-title {
        font-size: 0.85rem;
        flex: 1;
        min-width: 0;
    }
    
    .collapsible-header .section-title i {
        margin-right: 6px;
    }
    
    .collapsible-content {
        padding: 0 12px 12px 12px;
    }
    
    .collapsible-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .collapsible-header-actions .btn {
        flex: 1;
        text-align: center;
    }
    
    .section-toggle-icon {
        font-size: 0.8rem;
    }
    
    /* Search Results - Mobile layout */
    .search-results-active {
        padding: 12px;
        border-radius: var(--border-radius);
    }
    
    .search-results-header-bar .section-title {
        font-size: 0.9rem;
    }
    
    /* Kbd styling on mobile (if visible) */
    .search-hint .kbd {
        padding: 1px 5px;
        font-size: 0.7rem;
    }
}

/* Very small screens (360px and below) */
@media (max-width: 360px) {
    .search-hero {
        padding: 12px 8px;
    }
    
    .search-hero-container {
        padding: 3px 3px 3px 10px;
    }
    
    .search-hero-input {
        font-size: 0.9rem;
    }
    
    .search-hero-btn {
        width: 34px;
        height: 34px;
    }
    
    .collapsible-header .section-title {
        font-size: 0.8rem;
    }
}

/* ============================================
   RANKINGS TAB STYLES
   ============================================ */

/* Rankings Panel */
.rankings-panel {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.auto-record-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--success-bg, rgba(52, 211, 153, 0.1));
    color: var(--success-color, #34d399);
    padding: 8px 14px;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--success-color, #34d399);
}

.auto-record-badge i {
    font-size: 0.9rem;
}

.rankings-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.rankings-stat {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--border-color);
}

.rankings-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.rankings-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Rankings Table */
.rankings-table-container {
    overflow-x: auto;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
}

.rankings-table th {
    background: var(--bg-tertiary);
    padding: 12px 8px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.rankings-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.rankings-table th.sortable:hover {
    color: var(--primary-color);
}

.rankings-table th.sortable::after {
    content: '';
    display: inline-block;
    margin-left: 5px;
    width: 0;
    height: 0;
}

.rankings-table th.sort-asc::after {
    content: '▲';
    font-size: 0.7rem;
    color: var(--primary-color);
}

.rankings-table th.sort-desc::after {
    content: '▼';
    font-size: 0.7rem;
    color: var(--primary-color);
}

.rankings-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.rankings-table .ranking-row:hover {
    background: rgba(54, 226, 170, 0.05);
}

/* Cell Types */
.rank-cell {
    font-weight: 700;
    color: var(--text-secondary);
    width: 40px;
    text-align: center;
}

.token-cell {
    min-width: 120px;
}

.token-symbol {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

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

.score-cell {
    font-weight: 600;
    text-align: center;
    width: 65px;
}

.score-cell.score-high {
    color: #34d399;
}

.score-cell.score-good {
    color: #38bdf8;
}

.score-cell.score-moderate {
    color: #fbbf24;
}

.score-cell.score-low {
    color: #ff5c7a;
}

.pred-cell {
    text-align: center;
    width: 80px;
}

.prediction {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.prediction.pred-up {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.prediction.pred-down {
    background: rgba(255, 92, 122, 0.15);
    color: #ff5c7a;
}

.actions-cell {
    text-align: center;
    width: 70px;
}

.actions-cell .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: all 0.2s ease;
}

.actions-cell .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.actions-cell .btn i {
    font-size: 0.9rem;
}

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

.actions-cell .btn-secondary:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.scored-cell {
    text-align: center;
    width: 75px;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.75rem;
}

/* Prediction Accuracy Panel */
.prediction-accuracy-panel {
    margin-top: 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.accuracy-summary h3,
.tier-performance h3,
.recent-predictions h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accuracy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.accuracy-card {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--border-color);
}

.accuracy-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

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

.accuracy-value.positive {
    color: #34d399;
}

.accuracy-value.negative {
    color: #ff5c7a;
}

.accuracy-sample {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Tier Performance Grid */
.tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.tier-card {
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--border-color);
}

.tier-card.tier-high {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(52, 211, 153, 0.05) 100%);
    border-color: rgba(52, 211, 153, 0.3);
}

.tier-card.tier-good {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(56, 189, 248, 0.05) 100%);
    border-color: rgba(56, 189, 248, 0.3);
}

.tier-card.tier-moderate {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.tier-card.tier-low {
    background: linear-gradient(135deg, rgba(255, 92, 122, 0.1) 0%, rgba(255, 92, 122, 0.05) 100%);
    border-color: rgba(255, 92, 122, 0.3);
}

.tier-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

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

.tier-value.positive {
    color: #34d399;
}

.tier-value.negative {
    color: #ff5c7a;
}

.tier-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Predictions Table */
#predictions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#predictions-table th {
    background: var(--bg-tertiary);
    padding: 10px 8px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

#predictions-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

#predictions-table .actual-cell.correct {
    color: #34d399;
    font-weight: 600;
}

#predictions-table .actual-cell.wrong {
    color: #ff5c7a;
    font-weight: 600;
}

/* Prediction Stats Bar */
.prediction-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Mobile Responsiveness for Rankings */
@media (max-width: 768px) {
    .rankings-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rankings-stat .stat-value {
        font-size: 1.25rem;
    }
    
    /* Make rankings table scrollable horizontally */
    .rankings-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .rankings-table {
        min-width: 700px;
    }
    
    .rankings-table th,
    .rankings-table td {
        padding: 8px 6px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .token-cell {
        min-width: 80px;
    }
    
    .token-name {
        display: none;
    }
    
    .accuracy-grid,
    .tier-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Rankings panel header mobile */
    .rankings-panel .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .rankings-panel .panel-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .rankings-panel .panel-actions select,
    .rankings-panel .panel-actions button {
        flex: 1;
        min-width: 120px;
    }
    
    .auto-record-badge {
        padding: 6px 10px;
        font-size: 0.75rem;
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }
    
    .scored-cell {
        width: 60px;
        font-size: 0.7rem;
    }
    
    /* Actions cell on mobile */
    .actions-cell {
        width: 50px;
    }
    
    .actions-cell .btn {
        padding: 4px 8px;
    }
    
    .actions-cell .btn i {
        font-size: 0.8rem;
    }
    
    /* Predictions table scrollable */
    .recent-predictions {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #predictions-table {
        min-width: 500px;
    }
    
    /* Accuracy panel header mobile */
    .prediction-accuracy-panel .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .prediction-accuracy-panel .panel-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .rankings-summary {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .rankings-stat {
        padding: 10px;
    }
    
    .rankings-stat .stat-value {
        font-size: 1.1rem;
    }
    
    .rankings-stat .stat-label {
        font-size: 0.65rem;
    }
    
    /* Stack prediction cells */
    .rankings-table .pred-cell {
        width: 55px;
    }
    
    .prediction {
        padding: 2px 5px;
        font-size: 0.65rem;
    }
    
    .rank-cell {
        width: 30px;
        font-size: 0.8rem;
    }
    
    .score-cell {
        width: 45px;
        font-size: 0.8rem;
    }
    
    .scored-cell {
        width: 50px;
        font-size: 0.65rem;
    }
    
    /* Actions cell on very small screens */
    .actions-cell {
        width: 40px;
    }
    
    .actions-cell .btn {
        padding: 3px 6px;
    }
    
    .auto-record-badge {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
    
    .auto-record-badge i {
        display: none;
    }
    
    .accuracy-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }
    
    .accuracy-card {
        padding: 8px;
    }
    
    .accuracy-label {
        font-size: 0.65rem;
    }
    
    .accuracy-value {
        font-size: 1rem;
    }
    
    .accuracy-sample {
        font-size: 0.6rem;
    }
    
    .tier-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .tier-card {
        padding: 10px;
    }
    
    .tier-label {
        font-size: 0.7rem;
    }
    
    .tier-value {
        font-size: 1rem;
    }
    
    .tier-count {
        font-size: 0.6rem;
    }
    
    #predictions-table th,
    #predictions-table td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
    
    /* Prediction stats */
    .prediction-stats {
        flex-direction: column;
        gap: 8px;
        font-size: 0.8rem;
    }
    
    /* Section titles on mobile */
    .accuracy-summary h3,
    .tier-performance h3,
    .recent-predictions h3 {
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .rankings-summary {
        grid-template-columns: 1fr;
    }
    
    .accuracy-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .tier-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .rankings-table {
        min-width: 600px;
    }
    
    .rankings-table th,
    .rankings-table td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
    
    .scored-cell {
        display: none;
    }
    
    .auto-record-badge {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   ATH (All-Time High) Alerts Styles
   ============================================ */

.ath-panel {
    margin-bottom: var(--spacing-lg);
}

.ath-config-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.ath-config-section h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.config-item label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.config-item small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.config-input {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.config-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.config-item.inline-config {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0;
}

.config-item.inline-config label {
    margin: 0;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.config-item.inline-config .config-input.small {
    width: 80px;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.toggle {
    position: relative;
    width: 50px;
    height: 26px;
}

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

.toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-secondary);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .slider {
    background-color: var(--primary-color);
}

.toggle input:checked + .slider:before {
    transform: translateX(24px);
    background-color: white;
}

.ath-stats-section {
    margin-bottom: var(--spacing-lg);
}

.ath-stats-section .stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.ath-stats-section .stat-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-xs);
    transition: all 0.2s ease;
}

.ath-stats-section .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ath-stats-section .stat-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: var(--spacing-xs);
}

/* Icon colors for each stat type */
.ath-stats-section .stat-card:nth-child(1) .stat-icon {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

.ath-stats-section .stat-card:nth-child(2) .stat-icon {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.ath-stats-section .stat-card:nth-child(3) .stat-icon {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.ath-stats-section .stat-card:nth-child(4) .stat-icon {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
}

.ath-stats-section .stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ath-stats-section .stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.ath-stats-section .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ath-alerts-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.ath-alerts-section h3 {
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.ath-filters {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.filter-select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.ath-table-container {
    overflow-x: auto;
}

/* Mobile cards hidden by default on desktop */
.ath-mobile-cards {
    display: none;
}

.ath-table {
    width: 100%;
    border-collapse: collapse;
}

.ath-table th,
.ath-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.ath-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Token age badges */
.token-age {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.token-age.very-new {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    color: white;
    animation: newTokenPulse 2s ease-in-out infinite;
}

.token-age.new {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.token-age.recent {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.token-age.established {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.token-age.veteran {
    background: rgba(54, 226, 170, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(54, 226, 170, 0.3);
}

.token-age.unknown {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
    font-style: italic;
}

@keyframes newTokenPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0); }
}

/* Price change indicators */
.price-change {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.price-change.positive {
    color: #34d399;
}

.price-change.negative {
    color: #ff5c7a;
}

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

/* Direction badges */
.direction-badge {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.9rem;
    vertical-align: middle;
}

.direction-badge.rising {
    animation: rocketBounce 1s ease-in-out infinite;
}

.direction-badge.falling {
    opacity: 0.8;
}

@keyframes rocketBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Consolidation/Momentum Status Badges */
.consolidation-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: help;
}

.consolidation-badge.status-breakout {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
    /* Removed animation for performance - use static glow instead */
    box-shadow: 0 0 6px 1px rgba(249, 115, 22, 0.2);
}

.consolidation-badge.status-momentum {
    background: rgba(61, 220, 151, 0.15);
    color: #3ddc97;
    border: 1px solid rgba(61, 220, 151, 0.3);
}

.consolidation-badge.status-watching {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.consolidation-badge.status-resistance {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.consolidation-badge.status-stale {
    background: rgba(255, 92, 122, 0.15);
    color: #ff5c7a;
    border: 1px solid rgba(255, 92, 122, 0.3);
    opacity: 0.8;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
    50% { box-shadow: 0 0 8px 2px rgba(249, 115, 22, 0.2); }
}

/* Status Legend */
.status-legend {
    margin-bottom: 1rem;
}

.legend-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.legend-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.legend-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.75rem;
    display: grid;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.legend-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .consolidation-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    .legend-content {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .legend-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .legend-desc {
        font-size: 0.75rem;
        padding-left: 0.5rem;
    }
}

.token-info {
    display: flex;
    flex-direction: column;
}

.token-symbol {
    font-weight: 600;
    color: var(--text-primary);
}

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

.alert-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.alert-type.type-new-ath {
    background: rgba(255, 92, 122, 0.2);
    color: var(--accent-red);
}

.alert-type.type-ath-break {
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent-orange);
}

.alert-type.type-near-ath {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent-blue);
}

.distance {
    font-weight: 600;
}

.distance.positive {
    color: var(--success-color);
}

.distance.negative {
    color: var(--text-secondary);
}

/* Liquidity display styles */
.liquidity-cell {
    white-space: nowrap;
}

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

.liquidity-value {
    font-weight: 500;
    color: var(--text-primary);
}

.liquidity-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.liquidity-link:hover {
    text-decoration: underline;
}

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

/* Liquidity level colors for mobile */
.liquidity-high {
    color: var(--success-color) !important;
}

.liquidity-medium {
    color: #fbbf24 !important;
}

.liquidity-low {
    color: var(--text-muted) !important;
}

/* Mobile liquidity stat styling */
.liquidity-stat .liquidity-value {
    font-variant-numeric: tabular-nums;
}

/* Load liquidity button - desktop */
.btn-load-liquidity {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    min-width: 32px;
    min-height: 28px;
}

.btn-load-liquidity:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-load-liquidity:active {
    transform: scale(0.95);
}

/* Load liquidity button - mobile (larger touch target) */
.btn-load-liquidity-mobile {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    min-width: 44px;  /* Apple's recommended touch target */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-load-liquidity-mobile:hover,
.btn-load-liquidity-mobile:active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Chain badge in liquidity cell */
.chain-badge {
    display: inline-block;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: middle;
}

.action-buttons {
    display: flex;
    gap: var(--spacing-xs);
}

.action-buttons .btn-success {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    border-color: #059669;
    color: white;
}

.action-buttons .btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: scale(1.05);
}

.action-buttons .btn-success:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.action-buttons .manual-buy-loading {
    min-width: 130px;
    justify-content: center;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    margin-bottom: var(--spacing-md);
}

/* Notification Styles */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-success {
    background: var(--success-color);
    color: white;
}

.notification-error {
    background: var(--danger-color);
    color: white;
}

.notification-info {
    background: var(--info-color);
    color: white;
}

/* Mobile notification styling */
@media (max-width: 480px) {
    .notification {
        left: 10px;
        right: 10px;
        bottom: 10px;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
        max-width: none;
        width: auto;
    }
}

/* Mobile responsiveness for ATH - Tablet */
@media (max-width: 768px) {
    .ath-panel .panel-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: stretch;
    }
    
    .ath-panel .panel-header h2 {
        font-size: 1.25rem;
        text-align: center;
    }
    
    .ath-panel .panel-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
    }
    
    .ath-panel .panel-actions .btn {
        justify-content: center;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .config-actions {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .config-actions .toggle-container {
        justify-content: space-between;
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .config-actions .toggle-container:last-of-type {
        border-bottom: none;
    }
    
    .config-item.inline-config {
        flex-direction: row;
        justify-content: space-between;
        padding: var(--spacing-sm) 0;
    }
    
    .ath-stats-section {
        margin-bottom: var(--spacing-md);
    }
    
    /* ATH Stats Cards - Mobile optimized */
    .ath-stats-section .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .ath-stats-section .stat-card {
        padding: var(--spacing-md);
        flex-direction: column;
        align-items: center;
        text-align: center;
        min-height: 100px;
    }
    
    .ath-stats-section .stat-icon {
        font-size: 1.25rem;
        width: 44px;
        height: 44px;
        margin-bottom: var(--spacing-xs);
    }
    
    .ath-stats-section .stat-value {
        font-size: 1.5rem;
        font-weight: 700;
    }
    
    .ath-stats-section .stat-label {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .ath-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    .ath-filters .filter-select {
        flex: 1;
        min-width: 140px;
        padding: 12px;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .ath-table-container {
        display: none !important;
    }
    
    /* Show mobile card layout on tablets too */
    .ath-mobile-cards {
        display: flex !important;
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .ath-alerts-section {
        padding: var(--spacing-md);
    }
    
    .ath-alerts-section h3 {
        font-size: 1.1rem;
        margin-bottom: var(--spacing-md);
    }
    
    .ath-config-section {
        padding: var(--spacing-md);
    }
}

/* Mobile card styles - apply from 768px down */
@media (max-width: 768px) {
    .ath-mobile-card {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        padding: var(--spacing-md);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .ath-mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: var(--spacing-md);
        padding-bottom: var(--spacing-sm);
        border-bottom: 1px solid var(--border-color);
    }
    
    .ath-mobile-card-badges {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
    
    .ath-mobile-card-token {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .ath-mobile-card-symbol {
        font-weight: 700;
        font-size: 1.25rem;
        color: var(--text-primary);
    }
    
    .ath-mobile-card-name {
        font-size: 0.85rem;
        color: var(--text-secondary);
    }
    
    .ath-mobile-card-type {
        padding: 6px 10px;
        border-radius: var(--radius-md);
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    .ath-mobile-card-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }
    
    .ath-mobile-card-stat {
        display: flex;
        flex-direction: column;
        padding: var(--spacing-xs);
        background: var(--bg-tertiary);
        border-radius: var(--radius-sm);
    }
    
    .ath-mobile-card-stat-label {
        font-size: 0.7rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 2px;
    }
    
    .ath-mobile-card-stat-value {
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-primary);
    }
    
    .ath-mobile-card-stat-value.positive {
        color: var(--positive-color);
    }
    
    .ath-mobile-card-stat-value.negative {
        color: var(--negative-color);
    }
    
    .ath-mobile-card-footer {
        display: flex;
        justify-content: flex-end;
        margin-bottom: var(--spacing-sm);
        padding-top: var(--spacing-xs);
    }
    
    .ath-mobile-card-detected {
        font-size: 0.75rem;
        color: var(--text-muted);
        font-style: italic;
    }
    
    .ath-mobile-card-actions {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: var(--spacing-sm);
    }
    
    .ath-mobile-card-actions .btn {
        justify-content: center;
        padding: 12px var(--spacing-sm);
        font-size: 0.85rem;
        font-weight: 600;
        border-radius: var(--radius-md);
    }
    
    .ath-mobile-card-actions .btn i {
        margin-right: 4px;
    }
    
    /* Buy button styling */
    .ath-mobile-card-actions .btn-success {
        background: linear-gradient(135deg, #34d399 0%, #059669 100%);
        border-color: #059669;
    }

    .ath-mobile-card-actions .btn-success:hover {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
    }

    .ath-mobile-card-actions .manual-buy-loading {
        grid-column: 1 / -1;
    }
}

/* Small phones - extra optimizations */
@media (max-width: 480px) {
    .ath-panel {
        margin: 0 -8px;
        border-radius: 0;
    }
    
    .ath-panel .panel-header h2 {
        font-size: 1.1rem;
    }
    
    .ath-panel .panel-actions {
        grid-template-columns: 1fr;
    }
    
    /* ATH Stats - Small phones */
    .ath-stats-section .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .ath-stats-section .stat-card {
        padding: 12px 8px;
        min-height: 90px;
    }
    
    .ath-stats-section .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .ath-stats-section .stat-value {
        font-size: 1.4rem;
    }
    
    .ath-stats-section .stat-label {
        font-size: 0.6rem;
    }
    
    .ath-filters {
        flex-direction: column;
    }
    
    .ath-filters .filter-select {
        width: 100%;
    }
    
    .ath-mobile-card {
        padding: var(--spacing-sm);
        border-radius: var(--radius-md);
    }
    
    .ath-mobile-card-symbol {
        font-size: 1.15rem;
    }
    
    .ath-mobile-card-name {
        font-size: 0.8rem;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .ath-mobile-card-type {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
    
    .ath-mobile-card-stats {
        gap: var(--spacing-xs);
    }
    
    .ath-mobile-card-stat {
        padding: 6px;
    }
    
    .ath-mobile-card-stat-label {
        font-size: 0.6rem;
    }
    
    .ath-mobile-card-stat-value {
        font-size: 0.9rem;
    }
    
    .ath-mobile-card-actions {
        grid-template-columns: 1fr 1fr 1fr;
        gap: var(--spacing-xs);
    }
    
    .ath-mobile-card-actions .btn {
        padding: 10px 6px;
        font-size: 0.75rem;
    }
    
    .ath-mobile-card-actions .btn i {
        margin-right: 2px;
    }
    
    /* Handle button loading state */
    .ath-mobile-card-actions .btn:disabled {
        opacity: 0.7;
        cursor: wait;
    }
    
    /* Ensure button text doesn't overflow */
    .ath-mobile-card-actions .btn {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .config-item label {
        font-size: 0.85rem;
    }
    
    .config-input {
        font-size: 16px; /* Prevent iOS zoom */
        padding: 12px;
    }
    
    .ath-config-section h3,
    .ath-alerts-section h3 {
        font-size: 1rem;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .ath-mobile-card-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .ath-mobile-card-actions {
        grid-template-columns: 1fr;
    }
    
    /* ATH Stats - Extra small phones */
    .ath-stats-section .stat-cards {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .ath-stats-section .stat-card {
        padding: 10px 6px;
        min-height: 85px;
    }
    
    .ath-stats-section .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .ath-stats-section .stat-value {
        font-size: 1.2rem;
    }
    
    .ath-stats-section .stat-label {
        font-size: 0.55rem;
    }
}

/* ========== ATH Detection Time Highlighting ========== */

/* Desktop table - detected time column */
.detected-time {
    font-weight: 500;
    white-space: nowrap;
}

.detected-time.detected-very-recent {
    color: #34d399;
    font-weight: 700;
    /* Removed animation for performance */
    text-shadow: 0 0 8px rgba(52, 211, 153, 0.3);
}

.detected-time.detected-recent {
    color: #fbbf24;
    font-weight: 600;
}

/* Mobile card detected styling */
.ath-mobile-card-stat-value.detected-very-recent {
    color: #34d399 !important;
    font-weight: 700 !important;
    text-shadow: 0 0 6px rgba(52, 211, 153, 0.3);
}

.ath-mobile-card-stat-value.detected-recent {
    color: #fbbf24 !important;
    font-weight: 600 !important;
}

/* First seen info in mobile cards */
.ath-mobile-card-first-seen {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Update mobile footer to handle both items */
.ath-mobile-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* Text muted helper for first seen in desktop */
.detected-time + br + small.text-muted,
td small.text-muted {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ========== ATH Date (when ATH was set) Highlighting ========== */

.ath-date {
    font-weight: 500;
    white-space: nowrap;
}

/* ATH set within the last 24 hours - very fresh, highlight green */
.ath-date.ath-date-very-fresh,
.ath-mobile-card-stat-value.ath-date-very-fresh {
    color: #34d399 !important;
    font-weight: 700 !important;
}

/* ATH set within the last 7 days - fresh, highlight orange */
.ath-date.ath-date-fresh,
.ath-mobile-card-stat-value.ath-date-fresh {
    color: #fbbf24 !important;
    font-weight: 600 !important;
}

/* Ensure time strings don't overflow on mobile */
.ath-mobile-card-stat-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Desktop table detected time column - ensure it fits */
td .detected-time {
    white-space: nowrap;
}

/* Mobile: Allow 3-column layout on larger phones for more stats */
@media (min-width: 480px) and (max-width: 768px) {
    .ath-mobile-card-stats {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ════════════════════════════════════════════════════════════════
   UI refresh: typography, focus states, touch targets, polish
   ════════════════════════════════════════════════════════════════ */

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Accessible, modern focus rings */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Inputs inside composite search pills show focus on their container instead */
.search-hero-input,
.search-hero-input:focus,
.search-hero-input:focus-visible,
.search-input:focus,
.search-input:focus-visible {
    outline: none;
}

button, a, input, select, textarea {
    -webkit-tap-highlight-color: transparent;
}

/* Subtle lift on interactive cards */
.panel, .stat-card, .card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
    border-color: var(--border-accent);
}

/* Slimmer, themed scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
}
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
*::-webkit-scrollbar-track {
    background: transparent;
}

/* Mobile ergonomics: comfortable touch targets and spacing */
@media (max-width: 768px) {
    .btn, button.btn, .btn-primary, .btn-danger, .btn-secondary {
        min-height: 42px;
    }

    input.config-input,
    select.filter-select,
    input.filter-input {
        min-height: 42px;
        font-size: 16px; /* prevents iOS zoom-on-focus */
    }

    .page-content {
        padding: 0.75rem;
    }

    .panel-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .panel-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .panel-actions .btn {
        flex: 1;
        justify-content: center;
    }

    /* Tables scroll smoothly inside their containers */
    .ath-table-container,
    .table-responsive,
    .results-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ════════════════════════════════════════════════════════════════
   Aurora theme polish
   ════════════════════════════════════════════════════════════════ */

/* Number-heavy cells read better in the mono face */
.ath-table td,
.scanner-table td,
.rankings-table td {
    font-variant-numeric: tabular-nums;
}

/* Softer card entrance on page load */
@media (prefers-reduced-motion: no-preference) {
    .panel,
    .stat-card {
        animation: aurora-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    @keyframes aurora-rise {
        from {
            opacity: 0;
            transform: translateY(8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Extra mobile ergonomics */
@media (max-width: 768px) {
    select,
    input[type="text"],
    input[type="number"],
    input[type="search"] {
        font-size: 16px; /* prevents iOS zoom-on-focus */
    }

    .modal-content {
        border-radius: 20px 20px 0 0;
        width: 100%;
        max-width: none;
        max-height: 88%;
        align-self: flex-end;
    }

    .modal {
        align-items: flex-end;
    }
}

/* ── Resistance Breakouts page ──────────────────────────────── */
.bo-intro {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1.25rem;
    max-width: 720px;
}

.bo-timeframe-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.bo-tf-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-card) 65%, transparent);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.bo-tf-chip:hover {
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.bo-tf-chip input {
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.bo-tf-chip:has(input:checked) {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

.bo-tf-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    background: color-mix(in srgb, var(--accent-primary) 22%, transparent);
    color: var(--accent-primary);
    margin: 1px 0;
}
