/**
 * Market Screener Page Styles
 * Ultra-modern design with cosmic effects, glassmorphism, and neon animations
 */

/* ============================================
   CSS Variables & Cosmic Background
   ============================================ */
:root {
    --neon-cyan: #22d3ee;
    --neon-purple: #a855f7;
    --neon-blue: #3b82f6;
    --glass-bg: rgba(15, 15, 25, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --screener-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
}

/* Page Background */
body.screener-body,
.screener-main {
    background: linear-gradient(135deg, #0a0a0f 0%, #0d0d18 50%, #0a0a12 100%);
    min-height: 100vh;
    position: relative;
}

.screener-main::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(34, 211, 238, 0.4), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(59, 130, 246, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(168, 85, 247, 0.5), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(34, 211, 238, 0.3), transparent);
    background-size: 200px 200px;
    animation: starTwinkle 4s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes starTwinkle {
    0% {
        opacity: 0.3;
    }

    100% {
        opacity: 0.6;
    }
}

/* ============================================
   Header - Cosmic Style
   ============================================ */
.screener-header {
    position: relative;
    padding: 140px 0 60px;
    overflow: hidden;
}

.screener-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 450px;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(34, 211, 238, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 50%);
    filter: blur(60px);
    pointer-events: none;
    animation: headerPulse 6s ease-in-out infinite alternate;
}

@keyframes headerPulse {
    0% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
}

.header-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 28px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.9));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-icon {
    font-size: 44px;
    filter: drop-shadow(0 4px 20px rgba(34, 211, 238, 0.4));
}

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

.market-selector {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.95), rgba(20, 20, 35, 0.9));
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    backdrop-filter: blur(40px);
}

.market-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.market-btn:hover {
    color: var(--color-text-primary);
    background: rgba(34, 211, 238, 0.1);
}

.market-btn.active {
    background: var(--screener-gradient);
    color: white;
    box-shadow: 0 6px 25px rgba(34, 211, 238, 0.4);
}

/* ============================================
   Filters Panel - Glassmorphism
   ============================================ */
.filters-section {
    position: relative;
    padding: 0 0 36px;
}

.filters-panel {
    position: relative;
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.95), rgba(20, 20, 35, 0.9));
    backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 26px;
    padding: 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.filters-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.filters-panel:hover {
    border-color: rgba(34, 211, 238, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 0 40px rgba(34, 211, 238, 0.08);
}

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

.filters-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.9));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.reset-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 10px;
    transition: all 0.3s;
}

.reset-btn:hover {
    color: var(--color-negative);
    background: rgba(239, 68, 68, 0.12);
}

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

.filter-group label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.9), rgba(25, 25, 40, 0.8));
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    transition: all 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range-inputs input {
    flex: 1;
}

.range-inputs span {
    color: var(--color-text-muted);
    font-weight: 600;
}

.filters-actions {
    display: flex;
    gap: 16px;
}

.apply-btn,
.save-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.apply-btn {
    background: var(--screener-gradient);
    border: none;
    color: white;
    box-shadow: 0 8px 30px rgba(34, 211, 238, 0.4);
}

.apply-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 45px rgba(34, 211, 238, 0.5);
}

.save-btn {
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.9), rgba(25, 25, 40, 0.8));
    border: 1px solid var(--glass-border);
    color: var(--color-text-primary);
}

.save-btn:hover {
    border-color: var(--neon-cyan);
    background: rgba(34, 211, 238, 0.1);
}

/* ============================================
   Quick Filters - Neon Tags
   ============================================ */
.quick-filters {
    position: relative;
    padding: 0 0 36px;
}

.quick-filter-chips {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

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

.quick-chip {
    padding: 10px 20px;
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.9), rgba(25, 25, 40, 0.8));
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-chip:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
}

.quick-chip.active {
    background: var(--screener-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 25px rgba(34, 211, 238, 0.4);
}

/* ============================================
   Results Section
   ============================================ */
.results-section {
    position: relative;
    padding: 0 0 100px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 20px;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 24px;
}

.results-count {
    font-size: var(--font-size-xl);
    font-weight: 800;
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.9));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.results-time {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.results-actions select {
    padding: 12px 18px;
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.9), rgba(25, 25, 40, 0.8));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
}

.view-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.9), rgba(25, 25, 40, 0.8));
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.view-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.view-btn.active {
    background: var(--screener-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 25px rgba(34, 211, 238, 0.4);
}

/* ============================================
   Results Table - Glassmorphism
   ============================================ */
.results-table-wrapper {
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.95), rgba(20, 20, 35, 0.9));
    backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
}

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

.results-table th {
    text-align: left;
    padding: 18px 22px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.3s;
}

.results-table th.sortable:hover {
    color: var(--neon-cyan);
    background: rgba(34, 211, 238, 0.05);
}

.results-table td {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.results-table tbody tr {
    transition: all 0.3s;
    cursor: pointer;
}

.results-table tbody tr:hover {
    background: rgba(34, 211, 238, 0.05);
}

.asset-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.asset-cell img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border: 1px solid var(--glass-border);
}

.asset-info {
    display: flex;
    flex-direction: column;
}

.asset-symbol {
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.asset-name {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.price-cell {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: var(--font-size-base);
}

.change-cell {
    font-family: var(--font-mono);
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: var(--font-size-sm);
}

.change-cell.positive {
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-positive);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.15);
}

.change-cell.negative {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-negative);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.volume-cell,
.marketcap-cell {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.signal-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: var(--font-size-xs);
    font-weight: 700;
}

.signal-cell.bullish {
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-positive);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.15);
}

.signal-cell.bearish {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-negative);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.signal-cell.neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted);
}

.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.action-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(34, 211, 238, 0.1);
}

/* ============================================
   Cards View - Glassmorphism
   ============================================ */
.results-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.results-cards.hidden {
    display: none;
}

.result-card {
    position: relative;
    background: linear-gradient(145deg, rgba(15, 15, 25, 0.95), rgba(20, 20, 35, 0.9));
    backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 26px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.result-card:hover {
    border-color: rgba(34, 211, 238, 0.4);
    transform: translateY(-8px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35), 0 0 40px rgba(34, 211, 238, 0.12);
}

.result-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.result-card-header img {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.result-card-info {
    flex: 1;
}

.result-card-info h4 {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.result-card-info span {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.result-card-price {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 20px;
}

.result-card-price .price {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.9));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.result-stat {
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
}

.result-stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.result-stat-value {
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* ============================================
   Pagination - Neon Style
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(20, 20, 30, 0.9), rgba(25, 25, 40, 0.8));
    border: 1px solid var(--glass-border);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.page-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.page-btn.active {
    background: var(--screener-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 25px rgba(34, 211, 238, 0.4);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .market-selector {
        width: 100%;
        overflow-x: auto;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .results-table th:nth-child(4),
    .results-table td:nth-child(4),
    .results-table th:nth-child(5),
    .results-table td:nth-child(5) {
        display: none;
    }

    .results-cards {
        grid-template-columns: 1fr;
    }
}