/* 
 * PredMarketSpread - Dark Minimalistic Theme
 * Inspired by terminal aesthetics with sharp accents
 */

:root {
    /* Base colors */
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-tertiary: #18181b;
    --bg-elevated: #1f1f23;
    
    /* Text */
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    
    /* Accents */
    --accent: #22d3ee;
    --accent-dim: rgba(34, 211, 238, 0.15);
    --accent-glow: rgba(34, 211, 238, 0.4);
    
    /* Semantic */
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    
    /* Platform colors */
    --polymarket: #3b82f6;
    --kalshi: #10b981;
    --opinion: #f97316;
    
    /* Borders */
    --border: #27272a;
    --border-subtle: #1f1f23;
    
    /* Fonts */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-primary);
}

/* Webkit scrollbar (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-elevated);
}

/* App Container */
.app {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Ethereal Shadow Background */
.app-ethereal-shadow {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ethereal-shadow-content {
    position: absolute;
    inset: -60px;
    filter: url(#ethereal-shadow-filter) blur(4px);
    background-color: rgba(34, 211, 238, 0.2);
    mask-image: url('https://framerusercontent.com/images/ceBGguIpUU8luwByxuQz79t7To.png');
    mask-size: cover;
    mask-repeat: no-repeat;
    mask-position: top left;
    width: calc(100% + 120px);
    height: calc(100% + 120px);
    min-width: 100vw;
    min-height: 100vh;
}

.ethereal-noise {
    position: absolute;
    inset: 0;
    background-image: url('https://framerusercontent.com/images/g0QcWrxr87K0ufOxIUFBakwYA8.png');
    background-size: 240px;
    background-repeat: repeat;
    opacity: 0.5;
}

.app > *:not(.app-ethereal-shadow) {
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-image {
    height: 48px;
    width: auto;
    object-fit: contain;
    background: transparent;
    mix-blend-mode: normal;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.refresh-countdown {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
    transition: color 0.2s;
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.3s, box-shadow 0.3s;
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
}

.status-dot.loading {
    background: var(--warning);
    box-shadow: 0 0 12px var(--warning);
    animation: pulse 1s infinite;
}

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

/* Status Indicator (In header, near refresh timer) */
.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    transition: background-color 0.3s, box-shadow 0.3s;
    flex-shrink: 0;
    margin-left: 8px;
}

.status-indicator.processing {
    background: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.status-indicator.success {
    background: #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
}

.status-indicator.error {
    background: #f87171;
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.6);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spinner-rotate 1s linear infinite;
}

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

.loading-info {
    flex: 1;
}

.loading-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.loading-progress {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Controls */
.controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    z-index: 1;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-group input[type="number"],
.control-group input[type="date"] {
    width: 120px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.control-group input[type="text"] {
    width: 120px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.control-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.control-group input[type="text"]::placeholder {
    color: var(--text-muted);
}

.control-group input[type="date"] {
    font-family: var(--font-sans);
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.control-group select {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    cursor: pointer;
    min-width: 140px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.control-group select option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.control-group.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
}

.control-group.checkbox-group.platform-exclusion-group {
    margin-top: 0;
}

.control-group.checkbox-group input[type="checkbox"] {
    width: 40px;
    height: 40px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 0;
}

.control-group.checkbox-group input[type="checkbox"]:hover {
    border-color: rgba(8, 145, 178, 0.6);
}

.control-group.checkbox-group input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(6, 182, 212, 0.8);
    outline-offset: 2px;
}

.control-group.checkbox-group input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 50%, #0891b2 75%, #0e7490 100%);
    border-color: rgba(8, 145, 178, 0.6);
}

.control-group.checkbox-group input[type="checkbox"]:checked::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #06b6d4, #0891b2, #06b6d4, #0e7490);
    background-size: 200% 200%;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
    opacity: 0.8;
}

.control-group.checkbox-group input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
}

.control-group.checkbox-group input[type="checkbox"]:checked:hover {
    border-color: rgba(6, 182, 212, 0.8);
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.4);
}

.control-group.checkbox-group input[type="checkbox"]:checked:hover::before {
    background: linear-gradient(135deg, #0891b2, #06b6d4, #0891b2, #0e7490);
    background-size: 200% 200%;
    animation: borderRotate 2s linear infinite;
    opacity: 1;
}

.control-group.checkbox-group label {
    margin: 0;
    cursor: pointer;
    text-transform: none;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: normal;
    white-space: nowrap;
    font-size: 14px;
}

.input-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-suffix input {
    padding-right: 28px;
}

/* Number Input with Chevrons */
.number-input-wrapper {
    position: relative;
    width: 120px;
}

.control-group .number-input-wrapper {
    width: 120px;
}

.number-input-wrapper input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.number-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.number-input-chevrons {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    height: 40px;
    justify-content: space-between;
    pointer-events: none;
}

.number-input-chevron-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    pointer-events: auto;
    border-radius: 2px;
}

.number-input-chevron-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.number-input-chevron-btn svg {
    width: 12px;
    height: 12px;
    stroke: var(--text-primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.number-input-suffix {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 13px;
    pointer-events: none;
}

.number-input-wrapper.has-suffix input {
    padding-right: 60px;
}

.calc-input-group .number-input-wrapper {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

.input-suffix span {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.advanced-filters-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.advanced-filters-content-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0;
}

.advanced-filters-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}

.advanced-filters-toggle span:first-child {
    flex: 1;
    text-align: center;
}

.advanced-filters-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.advanced-filters-toggle .toggle-icon {
    position: absolute;
    right: 16px;
    transition: transform 0.2s;
    font-size: 12px;
    color: var(--text-secondary);
}

.advanced-filters-toggle.open .toggle-icon {
    transform: rotate(180deg);
}

.advanced-filters-content {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 16px;
    align-items: flex-end;
    justify-content: center;
    margin-top: 12px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.advanced-filters-content > .control-group:nth-child(1) { grid-column: 1 / 2 !important; grid-row: 1 / 2 !important; }
.advanced-filters-content > .control-group:nth-child(2) { grid-column: 2 / 3 !important; grid-row: 1 / 2 !important; }
.advanced-filters-content > .control-group:nth-child(3) { grid-column: 3 / 4 !important; grid-row: 1 / 2 !important; }
.advanced-filters-content > .control-group:nth-child(4) { grid-column: 4 / 5 !important; grid-row: 1 / 2 !important; }
.advanced-filters-content > .control-group:nth-child(5) { grid-column: 5 / 6 !important; grid-row: 1 / 2 !important; }
.advanced-filters-content > .control-group:nth-child(6) { grid-column: 6 / 7 !important; grid-row: 1 / 2 !important; }
.advanced-filters-content > .control-group:nth-child(7) { grid-column: 1 / 2 !important; grid-row: 2 / 3 !important; }
.advanced-filters-content > .control-group:nth-child(8) { grid-column: 2 / 3 !important; grid-row: 2 / 3 !important; }
.advanced-filters-content > .control-group:nth-child(9) { grid-column: 3 / 4 !important; grid-row: 2 / 3 !important; }
.advanced-filters-content > .control-group:nth-child(10) { grid-column: 4 / 5 !important; grid-row: 2 / 3 !important; }
.advanced-filters-content > .control-group:nth-child(11) { grid-column: 5 / 6 !important; grid-row: 2 / 3 !important; }
.advanced-filters-content > .control-group:nth-child(12) { grid-column: 6 / 7 !important; grid-row: 2 / 3 !important; }

.controls-buttons {
    width: 100%;
    flex-basis: 100%;
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
}

.input-suffix span {
    position: absolute;
    right: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.filter-btn {
    position: relative;
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 50%, #0891b2 75%, #0e7490 100%);
    color: white;
    border: 2px solid rgba(8, 145, 178, 0.6);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 0;
}

.filter-btn > *:not(.button-shine) {
    position: relative;
    z-index: 2;
}

.filter-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #06b6d4, #0891b2, #06b6d4, #0e7490);
    background-size: 200% 200%;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
    opacity: 0.8;
}

.filter-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 50%, #0891b2 75%, #0e7490 100%);
    z-index: -1;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.5);
    border-color: rgba(6, 182, 212, 0.8);
}

.filter-btn:hover::after {
    background: linear-gradient(135deg, #155e75 0%, #0e7490 25%, #0891b2 50%, #06b6d4 75%, #0891b2 100%);
}

.filter-btn:hover::before {
    background: linear-gradient(135deg, #0891b2, #06b6d4, #0891b2, #0e7490);
    background-size: 200% 200%;
    animation: borderRotate 2s linear infinite;
    opacity: 1;
}

.filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.3);
}

.refresh-btn {
    position: relative;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.refresh-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.refresh-btn.loading .btn-text {
    opacity: 0;
}

.refresh-btn.loading .btn-loader {
    opacity: 1;
}

.refresh-btn.loading {
    pointer-events: none;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--bg-primary);
    border-radius: 50%;
    opacity: 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

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

.stat-card {
    padding: 20px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: border-color 0.3s, transform 0.2s;
    position: relative;
}

.stat-card.polymarket-card {
    border-color: var(--polymarket);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(59, 130, 246, 0.1));
}

.stat-card.kalshi-card {
    border-color: var(--kalshi);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(16, 185, 129, 0.1));
}

.stat-card.opinion-card {
    border-color: var(--opinion);
    background: linear-gradient(135deg, var(--bg-secondary), rgba(249, 115, 22, 0.1));
}

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

.stat-card.highlight {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-secondary), var(--accent-dim));
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-card.polymarket-card .stat-value {
    color: var(--polymarket);
}

.stat-card.kalshi-card .stat-value {
    color: var(--kalshi);
}

.stat-card.opinion-card .stat-value {
    color: var(--opinion);
}

.stat-checkbox-wrapper {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stat-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-checkbox:hover {
    border-color: var(--text-secondary);
}

.stat-checkbox:checked {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
}

.stat-checkbox:checked::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.stat-checkbox-label {
    margin: 0;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-card.polymarket-card .stat-checkbox:checked {
    background: var(--polymarket);
    border-color: var(--polymarket);
}

.stat-card.kalshi-card .stat-checkbox:checked {
    background: var(--kalshi);
    border-color: var(--kalshi);
}

.stat-card.opinion-card .stat-checkbox:checked {
    background: var(--opinion);
    border-color: var(--opinion);
}

.stat-card.highlight .stat-value {
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

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

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tag {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tag:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.filter-tag.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 3px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Tabs with Tubelight Effect */
.tabs {
    display: flex;
    justify-content: center;
    margin: 0 auto 20px;
    padding: 0;
}

.tabs-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(17, 17, 19, 0.5);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    padding: 4px;
    border-radius: 9999px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: fit-content;
}

.tab {
    position: relative;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 9999px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 1;
    white-space: nowrap;
}

.tab:hover {
    color: var(--accent);
}

.tab.active {
    color: var(--accent);
}

/* Tubelight indicator - the glowing background */
.tab-tubelight {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: 0; /* Will be set by JS */
    background: rgba(34, 211, 238, 0.15);
    border-radius: 9999px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
    /* Initial position will be set inline by JS immediately */
}

/* The light bar on top (the "tubelight") */
.tab-tubelight::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
    box-shadow: 
        0 0 10px rgba(34, 211, 238, 0.8),
        0 0 20px rgba(34, 211, 238, 0.5);
}

/* Additional glow layers for depth */
.tab-tubelight::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 10px;
    background: rgba(34, 211, 238, 0.3);
    border-radius: 50%;
    filter: blur(6px);
}

/* Table Container */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 1400px;
    margin: 0 auto;
}

/* Empty State */
.empty-state {
    padding: 80px 40px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-text {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 14px;
    color: var(--text-muted);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 14px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
    vertical-align: middle;
}

.data-table tbody tr {
    /* Removed transition to prevent layout thrashing during hover */
    cursor: pointer;
    /* No will-change to avoid triggering unnecessary optimizations */
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
    /* Disable transitions during hover to prevent blinking */
    transition: none !important;
}

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

/* Platform badges */
.platform-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.platform-badge.polymarket {
    background: rgba(59, 130, 246, 0.15);
    color: var(--polymarket);
}

.platform-badge.kalshi {
    background: rgba(16, 185, 129, 0.15);
    color: var(--kalshi);
}

.platform-badge.opinion_labs,
.platform-badge.opinion {
    background: rgba(249, 115, 22, 0.15);
    color: var(--opinion);
}

/* Price display */
.price {
    font-family: var(--font-mono);
    font-weight: 500;
}

.price.high {
    color: var(--success);
}

.price.low {
    color: var(--danger);
}

/* Spread badge */
.spread-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--accent-dim);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

/* Match confidence */
.match-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-fill {
    width: 60px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.match-fill-inner {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s;
}

.match-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Event title */
.event-title-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-title {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
}

/* Selected row highlighting */
.data-table tbody tr {
    cursor: pointer;
    /* Removed transition to prevent layout thrashing */
}

.data-table tbody tr:hover {
    background-color: var(--bg-elevated);
    /* Disable transitions during hover to prevent blinking */
    transition: none !important;
}

.data-table tbody tr.selected {
    background-color: var(--accent-dim);
    border-left: 3px solid var(--accent);
}

/* Calculator Section */
.calculator-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 0 auto;
    max-width: 800px;
    width: 100%;
}

.calculator-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.calculator-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calc-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-input-group.calc-checkbox-group {
    gap: 8px;
    align-items: center;
    text-align: center;
}

.calc-input-group.calc-checkbox-group > div {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    margin-left: 152px;
}

.calc-input-group.calc-checkbox-group .number-input-wrapper {
    width: 120px;
}

.calc-input-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.calc-input-group input {
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    max-width: 200px;
}

.calc-custom-prices {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.calc-custom-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    user-select: none;
}

.calc-custom-toggle input[type="checkbox"] {
    width: 40px;
    height: 40px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    position: relative;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 0;
}

.calc-custom-toggle input[type="checkbox"]:hover {
    border-color: rgba(8, 145, 178, 0.6);
}

.calc-custom-toggle input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(6, 182, 212, 0.8);
    outline-offset: 2px;
}

.calc-custom-toggle input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 50%, #0891b2 75%, #0e7490 100%);
    border-color: rgba(8, 145, 178, 0.6);
}

.calc-custom-toggle input[type="checkbox"]:checked::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #06b6d4, #0891b2, #06b6d4, #0e7490);
    background-size: 200% 200%;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
    opacity: 0.8;
}

.calc-custom-toggle input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
}

.calc-custom-toggle input[type="checkbox"]:checked:hover {
    border-color: rgba(6, 182, 212, 0.8);
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.4);
}

.calc-custom-toggle input[type="checkbox"]:checked:hover::before {
    background: linear-gradient(135deg, #0891b2, #06b6d4, #0891b2, #0e7490);
    background-size: 200% 200%;
    animation: borderRotate 2s linear infinite;
    opacity: 1;
}

.calc-custom-toggle span {
    margin: 0;
    cursor: pointer;
    text-transform: none;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: normal;
    white-space: nowrap;
}

.calc-custom-inputs {
    margin-top: 12px;
    display: none !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    transform: translateX(-12px);
}

.calc-custom-inputs.show {
    display: flex !important;
}

.calc-custom-prices {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.calc-custom-inputs .calc-input-group {
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
    flex: 0 1 auto;
}


.calc-custom-inputs .calc-input-group label {
    min-width: 140px;
    margin: 0;
    text-transform: none;
    font-weight: 400;
    font-size: 13px;
    flex-shrink: 0;
    white-space: nowrap;
}

.calc-custom-inputs .calc-input-group input {
    flex: 1;
    max-width: 150px;
}

.calc-results {
    margin-top: 16px;
}

.calc-result-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.calc-result-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.calc-opportunity-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-style: italic;
}

.calc-bet-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.calc-bet-item {
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
}

.calc-bet-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-bet-item-link:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.calc-bet-item-link:active {
    transform: translateY(0);
}

.calc-bet-amount {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent);
    margin-top: 8px;
    font-family: var(--font-mono);
}

.calc-bet-commission {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.calc-bet-detail {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    font-family: var(--font-mono);
}

.calc-profit-summary {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-profit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.calc-profit-item.highlight {
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 16px;
    font-weight: 600;
    color: var(--success);
}

.calc-hint {
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 10000 !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal.open {
    display: flex !important;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calculator-wrapper {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.calculator-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}

.calculator-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.calculator-toggle .toggle-icon {
    position: absolute;
    right: 16px;
    transition: transform 0.2s;
    font-size: 12px;
    color: var(--text-secondary);
}

.calculator-toggle.open .toggle-icon {
    transform: rotate(180deg);
}

.calculator-section {
    margin-top: 12px;
    width: 100%;
    display: none;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    max-height: 80vh;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-right: 40px;
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.modal-market {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.modal-market-title {
    font-size: 14px;
    margin-bottom: 8px;
}

.modal-market-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-market-link {
    color: var(--accent);
    text-decoration: none;
}

.modal-market-link:hover {
    text-decoration: underline;
}

/* View Market Button */
.view-market-btn {
    position: relative;
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 50%, #0891b2 75%, #0e7490 100%);
    border: 2px solid rgba(8, 145, 178, 0.6);
    border-radius: var(--radius);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 0;
    font-family: var(--font-sans);
}

.view-market-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #06b6d4, #0891b2, #06b6d4, #0e7490);
    background-size: 200% 200%;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
    opacity: 0.8;
}

.view-market-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 50%, #0891b2 75%, #0e7490 100%);
    z-index: -1;
}

.view-market-btn > * {
    position: relative;
    z-index: 2;
}

.view-market-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.5);
    border-color: rgba(6, 182, 212, 0.8);
}

.view-market-btn:hover::after {
    background: linear-gradient(135deg, #155e75 0%, #0e7490 25%, #0891b2 50%, #06b6d4 75%, #0891b2 100%);
}

.view-market-btn:hover::before {
    background: linear-gradient(135deg, #0891b2, #06b6d4, #0891b2, #0e7490);
    background-size: 200% 200%;
    animation: borderRotate 2s linear infinite;
    opacity: 1;
}

.view-market-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.3);
}

.no-link {
    display: block;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}


/* Responsive */
@media (max-width: 900px) {
    .controls {
        flex-wrap: wrap;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .scan-btn {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }
    
    .header-status {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .refresh-countdown {
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-status {
        width: 100%;
        justify-content: space-between;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .advanced-filters-content {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: auto !important;
    }
    
    .advanced-filters-content > .control-group:nth-child(n) {
        grid-column: auto !important;
        grid-row: auto !important;
    }
    
    .search-advanced-filters-content {
        flex-direction: column;
    }
    
    .search-filter-input {
        width: 100%;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 800px;
    }
    
    .calculator-section {
        padding: 16px;
    }
    
    .calc-custom-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .calc-custom-inputs .calc-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .calc-custom-inputs .calc-input-group label {
        min-width: auto;
        text-align: left;
    }
}

@media (max-width: 600px) {
    .app {
        padding: 12px;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .data-table {
        font-size: 12px;
        min-width: 700px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }
    
    /* Make event title full-width on mobile - user scrolls to see other columns */
    .data-table td:first-child {
        min-width: 350px !important;
        max-width: none !important;
        width: 350px !important;
    }
    
    .event-title-container {
        width: 100%;
        max-width: none !important;
    }
    
    .event-title {
        max-width: none !important;
        min-width: auto !important;
        width: 100% !important;
        font-size: 12px;
        line-height: 1.5;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .header-status {
        font-size: 12px;
    }
    
    .status-text {
        font-size: 11px;
    }
    
    .refresh-countdown {
        font-size: 10px;
        margin-left: 4px;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filter-tags {
        width: 100%;
        justify-content: flex-start;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .search-section {
        padding: 16px;
    }
    
    .tabs-inner {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .tab {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .calc-input-group.calc-checkbox-group > div {
        margin-left: 0;
        flex-direction: column;
        align-items: center;
    }
    
    .calc-input-group.calc-checkbox-group .number-input-wrapper {
        width: 100%;
        max-width: 200px;
    }
}

/* Search Section */
.search-section {
    padding: 24px 32px;
}

.search-container {
    display: flex;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

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

.search-btn {
    position: relative;
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 50%, #0891b2 75%, #0e7490 100%);
    color: white;
    border: 2px solid rgba(8, 145, 178, 0.6);
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 0;
}

.search-btn > *:not(.button-shine) {
    position: relative;
    z-index: 2;
}

.search-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #06b6d4, #0891b2, #06b6d4, #0e7490);
    background-size: 200% 200%;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
    opacity: 0.8;
}

.search-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 50%, #0891b2 75%, #0e7490 100%);
    z-index: -1;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.5);
    border-color: rgba(6, 182, 212, 0.8);
}

.search-btn:hover::after {
    background: linear-gradient(135deg, #155e75 0%, #0e7490 25%, #0891b2 50%, #06b6d4 75%, #0891b2 100%);
}

.search-btn:hover::before {
    background: linear-gradient(135deg, #0891b2, #06b6d4, #0891b2, #0e7490);
    background-size: 200% 200%;
    animation: borderRotate 2s linear infinite;
    opacity: 1;
}

.search-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.3);
}

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

/* Search Advanced Filters Row */
.search-advanced-filters-row {
    width: 100%;
    margin: 16px auto 0;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-basis: 100%;
}

/* Search Advanced Filters */
.search-advanced-filters-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-advanced-filters-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}

.search-advanced-filters-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.search-advanced-filters-toggle .toggle-icon {
    position: absolute;
    right: 16px;
    transition: transform 0.2s;
    font-size: 12px;
    color: var(--text-secondary);
}

.search-advanced-filters-toggle.open .toggle-icon {
    transform: rotate(180deg);
}

.search-advanced-filters-content-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.search-advanced-filters-content {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    align-items: flex-end;
    justify-content: center;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.search-filter-input {
    width: 250px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-filter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

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

/* Search Summary */
.search-summary {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.required-words-info {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.required-word-tags {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: 4px;
}

.required-word-tag {
    padding: 2px 8px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
}

.search-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.empty-required {
    margin: 12px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Matched Words */
.matched-words {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.matched-word {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 4px;
    background: var(--bg-elevated);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--success);
}

/* Search Results */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 8px;
}

.search-result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.search-result-header {
    padding: 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.search-result-header.kalshi-header {
    background: linear-gradient(135deg, var(--kalshi) 0%, rgba(16, 185, 129, 0.3) 100%);
}

.search-result-header.opinion-header {
    background: linear-gradient(135deg, var(--opinion) 0%, rgba(249, 115, 22, 0.3) 100%);
}

.search-result-card.kalshi-only {
    border-left: 3px solid var(--kalshi);
}

.search-result-platform {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
}

.search-result-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.search-result-price {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 14px;
}

.search-result-price .label {
    color: var(--text-muted);
}

.search-result-price .value {
    color: var(--success);
    font-weight: 600;
}

.search-result-category {
    padding: 4px 10px;
    background: var(--accent-dim);
    border-radius: 4px;
    font-size: 12px;
    color: var(--accent);
}

.search-result-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
}

.search-result-link:hover {
    text-decoration: underline;
}

.search-result-link.polymarket-link {
    color: var(--polymarket);
}

.search-result-link.polymarket-link:hover {
    color: var(--polymarket);
    opacity: 0.8;
}

/* Kalshi Matches */
.kalshi-matches {
    padding: 16px 20px;
}

.kalshi-matches-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--kalshi);
    margin-bottom: 12px;
}

.opinion-matches-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--opinion);
    margin-bottom: 12px;
}

.kalshi-match-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--kalshi);
    border-radius: var(--radius);
    margin-bottom: 10px;
    transition: background-color 0.2s;
}

.kalshi-match-item:hover {
    background: var(--bg-elevated);
}

.kalshi-match-item.selected {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--kalshi);
}

.kalshi-match-item:last-child {
    margin-bottom: 0;
}

.kalshi-match-info {
    flex: 1;
}

.kalshi-match-title {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.kalshi-match-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.kalshi-match-price {
    font-family: var(--font-mono);
    color: var(--success);
}

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

.kalshi-match-required {
    color: var(--accent);
    font-weight: 500;
}

.kalshi-match-spread {
    font-family: var(--font-mono);
    font-weight: 600;
}

.kalshi-match-spread.positive {
    color: var(--success);
}

.kalshi-match-spread.negative {
    color: var(--danger);
}

.kalshi-match-link {
    margin-left: 12px;
    padding: 8px 14px;
    background: var(--kalshi);
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.opinion-match-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--opinion);
    border-radius: var(--radius);
    margin-bottom: 10px;
    transition: background-color 0.2s;
}

.opinion-match-item:hover {
    background: var(--bg-elevated);
}

.opinion-match-item.selected {
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--opinion);
}

.opinion-match-item:last-child {
    margin-bottom: 0;
}

.opinion-match-info {
    flex: 1;
}

.opinion-match-title {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.opinion-match-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.opinion-match-price {
    font-family: var(--font-mono);
    color: var(--success);
}

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

.opinion-match-required {
    color: var(--accent);
    font-weight: 500;
}

.opinion-match-spread {
    font-family: var(--font-mono);
    font-weight: 600;
}

.opinion-match-spread.positive {
    color: var(--success);
}

.opinion-match-spread.negative {
    color: var(--danger);
}

.opinion-match-link {
    margin-left: 12px;
    padding: 8px 14px;
    background: var(--opinion);
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.opinion-match-link:hover {
    opacity: 0.9;
}

.kalshi-match-link:hover {
    opacity: 0.9;
}

.no-kalshi-match {
    color: var(--text-muted);
    font-style: italic;
    font-size: 13px;
    padding: 12px;
    text-align: center;
}

.search-count {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

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

.search-empty .empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.search-empty .empty-text {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.search-empty .empty-hint {
    color: var(--text-muted);
    font-size: 14px;
}

/* Landing Screen */
.landing-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0b;
    z-index: 10000;
    overflow: hidden;
}

.beams-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: blur(15px);
}

.beams-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 11, 0.05);
    backdrop-filter: blur(50px);
    animation: overlayPulse 10s ease-in-out infinite;
}

@keyframes overlayPulse {
    0%, 100% {
        opacity: 0.05;
    }
    50% {
        opacity: 0.15;
    }
}

.landing-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    padding: 24px;
    gap: 24px;
}

.landing-title {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 6rem;
    font-weight: 600;
    color: white;
    letter-spacing: -0.02em;
    margin: 0;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    line-height: 1.1;
}

.landing-subtitle-wrapper {
    position: relative;
    display: inline-block;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.landing-subtitle {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: -0.01em;
    margin: 0;
    position: relative;
    transition: transform 0.3s ease;
}

.landing-subtitle-wrapper:hover .landing-subtitle {
    transform: scale(1.02);
}

.landing-subtitle-underline {
    position: absolute;
    bottom: -16px;
    left: 0;
    width: 100%;
    height: 20px;
    color: rgba(255, 255, 255, 0.5);
    overflow: visible;
    transition: opacity 0.5s ease-in;
}

.typewriter-cursor {
    display: inline-block;
    animation: cursorBlink 1s infinite;
    margin-left: 2px;
}

@keyframes cursorBlink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.underline-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-button {
    position: relative;
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 50%, #0891b2 75%, #0e7490 100%);
    color: white;
    border: 2px solid rgba(8, 145, 178, 0.6);
    padding: 16px 48px;
    font-size: 1.125rem;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
    margin-top: 8px;
    overflow: hidden;
    z-index: 0;
}

.landing-button > *:not(.button-shine) {
    position: relative;
    z-index: 2;
}

.landing-button::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #06b6d4, #0891b2, #06b6d4, #0e7490);
    background-size: 200% 200%;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
    opacity: 0.8;
    border-radius: calc(var(--radius) + 2px);
}

.landing-button::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 25%, #06b6d4 50%, #0891b2 75%, #0e7490 100%);
    z-index: -1;
}

.landing-button .button-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.landing-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(8, 145, 178, 0.5);
    border-color: rgba(6, 182, 212, 0.8);
}

.landing-button:hover::after {
    background: linear-gradient(135deg, #155e75 0%, #0e7490 25%, #0891b2 50%, #06b6d4 75%, #0891b2 100%);
}

.landing-button:hover::before {
    background: linear-gradient(135deg, #0891b2, #06b6d4, #0891b2, #0e7490);
    background-size: 200% 200%;
    animation: borderRotate 2s linear infinite;
    opacity: 1;
}

.landing-button:hover .button-shine {
    left: 100%;
}

.landing-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.3);
}

@keyframes borderRotate {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@media (max-width: 768px) {
    .landing-title {
        font-size: 4rem;
    }
    
    .landing-subtitle-wrapper {
        font-size: 1.25rem;
    }
    
    .landing-subtitle {
        font-size: 1.25rem;
    }
    
    .landing-button {
        padding: 14px 36px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .landing-title {
        font-size: 3rem;
    }
    
    .landing-subtitle-wrapper {
        font-size: 1rem;
    }
    
    .landing-subtitle {
        font-size: 1rem;
    }
}

/* Footer */
.app-footer {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 60px auto 0;
    padding: 48px 24px;
    border-top: 1px solid var(--border);
    background: radial-gradient(35% 128px at 50% 0%, rgba(255, 255, 255, 0.03), transparent);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.app-footer.visible {
    opacity: 1;
    transform: translateY(0);
}

.footer-divider {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 33.333%;
    height: 1px;
    background: var(--text-primary);
    opacity: 0.2;
    border-radius: 9999px;
    filter: blur(1px);
}

.footer-content {
    display: grid;
    width: 100%;
    gap: 32px;
}

@media (min-width: 1280px) {
    .footer-content {
        grid-template-columns: 1fr 2fr;
        gap: 32px;
    }
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-icon {
    width: 32px;
    height: 32px;
    color: var(--text-primary);
}

.footer-copyright {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.footer-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    margin-top: 40px;
}

@media (min-width: 768px) {
    .footer-links-grid {
        margin-top: 0;
    }
}

@media (min-width: 1280px) {
    .footer-links-grid {
        grid-column: 2;
    }
}

.footer-section {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.footer-section:nth-child(1) { animation-delay: 0.1s; }
.footer-section:nth-child(2) { animation-delay: 0.2s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 16px 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links li {
    margin: 0;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-social a {
    gap: 8px;
}

.footer-social-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.footer-social-icon path {
    fill: currentColor;
}

@media (prefers-reduced-motion: reduce) {
    .app-footer,
    .footer-section {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* FAQ Styles */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

.faq-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 40px;
    text-align: center;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.faq-item {
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.faq-question {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.faq-answer {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   Authentication Modal
   ============================================ */

.auth-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000 !important;
    backdrop-filter: blur(8px);
    padding: 20px;
    margin: 0 !important;
    box-sizing: border-box;
}

.auth-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 60vh;
    background: radial-gradient(ellipse at center, rgba(34, 211, 238, 0.15) 0%, transparent 70%);
    border-radius: 0 0 50% 50%;
    pointer-events: none;
}

.auth-modal-content {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(34, 211, 238, 0.1) inset;
    position: relative;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
    margin: 0 auto;
    flex-shrink: 0;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

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

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

.auth-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.auth-modal-close {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
}

.auth-modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--accent);
}

.auth-modal-body {
    padding: 24px;
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    margin-bottom: 12px;
    transition: all 0.3s;
    box-sizing: border-box;
}

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

.auth-input:focus {
    outline: none;
    background: var(--bg-elevated);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.auth-button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: var(--bg-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:hover {
    background: #06b6d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button-google {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
}

.auth-button-google:hover {
    background: var(--bg-elevated) !important;
    border-color: var(--accent) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 2px 8px rgba(34, 211, 238, 0.2);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-divider span {
    padding: 0 16px;
}

.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    margin: 16px 0 0 0;
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-switch a:hover {
    color: #06b6d4;
    text-decoration: underline;
}

.auth-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 12px;
    color: var(--danger);
    font-size: 14px;
    margin-top: 16px;
}

/* ============================================
   Profile Modal
   ============================================ */

.profile-modal-content {
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.profile-info {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.profile-email {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.profile-section {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 16px;
}

.profile-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-favorites-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-height: 400px;
    overflow-y: auto;
}

.profile-favorite-item {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-favorite-item:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
}

.profile-favorite-item.profile-favorite-unavailable {
    opacity: 0.6;
    cursor: default;
}

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

.profile-favorite-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
    padding-right: 32px;
}

.profile-favorite-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.profile-favorite-remove {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.profile-favorite-remove:hover {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
}

.profile-favorites-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.profile-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.profile-error {
    text-align: center;
    padding: 20px;
    color: var(--danger);
    font-size: 14px;
}

.profile-actions {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ============================================
   Favorites Button
   ============================================ */

.favorite-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.favorite-btn:hover {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
}

.favorite-btn.active {
    color: var(--danger);
}

.favorite-btn.active:hover {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.15);
}

/* Open detail button */
.open-detail-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: auto;
}

.open-detail-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--accent);
}

/* Category checkboxes */
.category-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.category-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.category-checkbox-label:hover {
    background: var(--bg-elevated);
}

.category-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

.category-checkbox-label span {
    user-select: none;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-top: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
    gap: 16px;
}

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

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-elevated);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.pagination-page {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
}

.pagination-page:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
}

.pagination-page.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: var(--text-muted);
    font-size: 14px;
}

