/* static/css/main.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    --card-bg: rgba(17, 25, 40, 0.85);
    --nav-bg: rgba(17, 25, 40, 0.95);
    --accent-color: #6366f1;
    --accent-gradient: linear-gradient(135deg, #08f7fe 0%, #6366f1 100%);
    --text-primary: #e8eaf6;
    --text-secondary: #a5b4fc;
    --success-color: #4ade80;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --border-color: rgba(99, 102, 241, 0.3);
}

body { 
    background: var(--primary-bg);
    color: var(--text-primary);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    font-size: 14px;
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== HEADINGS ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75em;
}

h1 {
    font-size: 28px;
    color: #00eaff;
    text-align: center;
}

h2 {
    font-size: 22px;
    color: #00eaff;
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
    padding-bottom: 8px;
    margin-top: 1.5em;
}

h3 {
    font-size: 18px;
    color: #90cdf4;
    margin: 1.2em 0 0.5em 0;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.6);
    border-left: 4px solid rgba(99, 102, 241, 0.6);
    border-radius: 0 8px 8px 0;
}

h4 {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 1em 0 0.5em 0;
}

/* ===== LISTS ===== */
ul, ol {
    margin: 1em 0;
    padding-left: 1.5em;
    color: var(--text-primary);
}

li {
    margin-bottom: 0.5em;
    padding-left: 0.5em;
}

/* Unordered list styling */
ul {
    list-style: none;
}

ul li {
    position: relative;
    padding-left: 1.2em;
}

ul li::before {
    content: '▸';
    color: rgba(99, 102, 241, 0.7);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Ordered list styling */
ol {
    list-style: decimal;
    color: var(--text-primary);
}

ol li {
    padding-left: 0.5em;
}

/* List links */
ul li a,
ol li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 14px;
}

ul li a:hover,
ol li a:hover {
    color: #00eaff;
    text-decoration: underline;
}

/* Special list styling for cards/content areas */
.content-area ul,
.content-area ol {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 1em 1em 1em 2.5em;
    margin: 1em 0;
}

.content-area li {
    margin-bottom: 0.75em;
    padding-left: 0.5em;
}

/* ===== NAVIGATION BAR ===== */
.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-logo {
    font-size: 22px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 40px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    gap: 5px;
    list-style: none;
    align-items: center;
}

.nav-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
    transform: translateY(-2px);
}

.nav-link.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.nav-toggle {
    display: none;
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
}

/* ===== MAIN CONTAINER ===== */
.container { 
    max-width: 1500px; 
    margin: 0 auto; 
    padding: 0 1px;
    background: var(--card-bg);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 80vh;
}

.header-container {
    text-align: center;
    margin: 14px 0 18px 0;
    padding: 0 20px;
}

.header-container h1 {
    font-size: 28px;
    font-weight: 700;
    color: #00eaff;
    margin: 0;
}

.tagline {
    font-size: 12.5px;
    font-weight: 500;
    margin: 4px 0 6px 0;
    color: #4cff4c;
    text-shadow: 0 0 5px rgba(76,255,76,0.35);
}

.header-info {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 13px;
    color: #bbb;
    margin-top: 4px;
    flex-wrap: wrap;
}

.update-time, #live-clock {
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 500;
}

.update-time {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

#live-clock {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ===== FILTERS ===== */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    align-items: center;
}

.filter-container label {
    align-self: center;
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 5px;
}

#timeframe-filter {
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 13px;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.filter-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.6);
    color: #c7d2fe;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #818cf8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.filter-btn.clear {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.4);
    color: #fca5a5;
}

.filter-btn.clear:hover {
    background: rgba(248, 113, 113, 0.3);
    border-color: rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

.filter-btn.clear.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #f87171;
    color: #fff;
}

/* ===== SEARCH CONTAINER ===== */
.search-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
    margin: 10px 15px 12px 15px;
    flex-wrap: wrap;
}

/* ===== SEARCH ===== */
#search-box {
    width: 280px;
    padding: 10px 16px;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

#search-box:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(30, 41, 59, 1);
}

#search-box::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

/* ===== SCREENER DESCRIPTION ===== */
.screener-description {
    flex: 1;
    padding: 10px 18px;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-left: 4px solid rgba(99, 102, 241, 0.6);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #94a3b8;
}

.screener-description strong {
    color: #00d9ff;
    font-weight: 600;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 968px) {
    .search-container {
        flex-direction: column;
        margin: 10px 10px 12px 10px;
    }
    
    #search-box {
        width: 100%;
    }
    
    .screener-description {
        font-size: 12px;
        padding: 12px 14px;
        width: 100%;
    }
    
    .screener-description strong {
        display: block;
        margin-bottom: 6px;
        font-size: 13px;
    }
}

/* ===== TABLE ===== */
.table-container {
    overflow-x: auto;
    margin: 0 15px 20px 15px;
    border-radius: 12px;
}

table { 
    width: 100%; 
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    font-size: 12px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

th { 
    background: linear-gradient(135deg, #1e2a45 0%, #2a3555 100%);
    padding: 12px 8px;
    border-bottom: 2px solid rgba(144, 205, 244, 0.3);
    color: #90cdf4;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.2s ease;
}

th.sortable:hover {
    background: linear-gradient(135deg, #2a3555 0%, #3a4565 100%);
    color: #a5b4fc;
}

th.sortable::after {
    content: '⇅';
    margin-left: 6px;
    opacity: 0.4;
    font-size: 11px;
}

th.sortable.asc::after {
    content: '▲';
    opacity: 1;
    color: var(--success-color);
}

th.sortable.desc::after {
    content: '▼';
    opacity: 1;
    color: var(--danger-color);
}

th.separator-left,
td.separator-left {
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}

td { 
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(45, 55, 72, 0.4);
    font-size: 12px;
    background: rgba(26, 32, 53, 0.5);
}

.coin-name {
    font-size: 14px !important;
    font-weight: 600;
    background: linear-gradient(135deg, #60a5fa 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

tbody tr {
    transition: all 0.3s ease;
}

tbody tr:hover { 
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* ===== COLOR CLASSES ===== */
.pos { 
    color: var(--success-color);
    font-weight: 600;
}
.neg { 
    color: var(--danger-color);
    font-weight: 600;
}

.rsi-up { 
    color: var(--success-color);
    font-weight: 600;
}
.rsi-side { 
    color: #60a5fa;
    font-weight: 600;
}
.rsi-down { 
    color: var(--danger-color);
    font-weight: 600;
}

.div-strong { 
    color: #c084fc;
    font-weight: 600;
}
.div-medium { 
    color: #e879f9;
    font-weight: 600;
}
.div-weak { 
    color: var(--warning-color);
    font-weight: 600;
}
.div-hidden { 
    color: #bef264;
    font-weight: 600;
}
.div-basic { 
    color: #86efac;
    font-weight: 600;
}
.div-none { 
    color: #64748b;
}

/* ===== DIVERGENCE STRENGTH ===== */
.div-strength {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.div-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.06);
}

.div-dot.filled {
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 0 15px;
}

.pagination-btn {
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.6);
    color: #c7d2fe;
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #818cf8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

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

/* ===== FOOTER ===== */
.footer {
    background: rgba(17, 25, 40, 0.95);
    border-top: 2px solid rgba(99, 102, 241, 0.3);
    padding: 30px 0;
    margin-top: 40px;
}

.footer-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 25px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    color: #00eaff;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 14px;
}

.footer-links a:hover {
    color: #00eaff;
}

.footer-bottom {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px 25px 0;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

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

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

/* ===== UTILITY CLASSES ===== */
.no-data {
    color: #94a3b8;
    font-style: italic;
}

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

.hidden {
    display: none !important;
}

/* ===== PAGINATION ===== */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 0 15px;
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.page-btn {
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-width: 44px;
    text-align: center;
}

.page-btn:hover:not(.disabled):not(.active) {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.6);
    color: #c7d2fe;
    transform: translateY(-2px);
}

.page-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #818cf8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.page-info {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

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

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination {
        gap: 4px;
    }
    
    .page-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 40px;
    }
    
    .page-info {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 2px;
    }
    
    .page-btn {
        padding: 4px 8px;
        font-size: 11px;
        min-width: 36px;
    }
    
    .page-info {
        font-size: 11px;
    }
}