/* static/css/style.css */
:root {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --up: #10b981;
    --down: #ef4444;
    --border: #334155;
    --header: #1e293b;
    --footer: #1e293b;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}


.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
}

.logo-icon {
    font-size: 20px;
}

.logo-text {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 20px;
}

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

.nav-links a:hover {
    color: var(--accent);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    margin: 0;
    font-size: 28px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.meta {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.next-funding {
    font-weight: bold;
    color: var(--accent);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

thead {
    background: #1e293b;
}

th,
td {
    padding: 14px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

.rank {
    font-weight: bold;
    color: var(--accent);
}

.positive {
    color: var(--up);
    font-weight: 600;
}

.negative {
    color: var(--down);
    font-weight: 600;
}

.timer {
    font-family: monospace;
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 14px;
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: var(--footer);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: #8b5cf6;
}

.donate-btn {
    background: linear-gradient(to right, #3b82f6, #ee5a52);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.donate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* === Анимации обновления === */
@keyframes highlight {
    0% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(59, 130, 246, 0.1);
    }

    100% {
        background-color: transparent;
    }
}

@keyframes pulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 0.7;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-container.loading tbody td {
    opacity: 0.6;
    animation: pulse 1.5s infinite;
}

tbody tr {
    transition: opacity 0.2s ease;
    animation: fadeIn 0.3s ease forwards;
}

tbody tr:nth-child(1) {
    animation-delay: 0.05s;
}

tbody tr:nth-child(2) {
    animation-delay: 0.10s;
}

tbody tr:nth-child(3) {
    animation-delay: 0.15s;
}

tbody tr:nth-child(4) {
    animation-delay: 0.20s;
}

tbody tr:nth-child(5) {
    animation-delay: 0.25s;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
}

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, var(--accent), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s;
    z-index: 101;
    opacity: 0;
    pointer-events: none;
}

.progress-bar.active {
    transform: scaleX(1);
    opacity: 1;
}

/* Мобильная версия */
@media (max-width: 480px) {

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        background: var(--card);
        margin-bottom: 12px;
        border-radius: 8px;
        padding: 10px;
        border: 1px solid var(--border);
    }

    tbody {
        border: none;
        width: 100%;
    }

    td {
        border: none;
        padding: 6px 8px;
        display: flex;
        justify-content: space-between;
        font-size: 14px;
    }

    td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
    }
}