/* ============================================================================
   MOEX Dividend Yield Dashboard - Vanilla HTML/CSS/JS
   Design Philosophy: Minimalist Financial Dashboard
   - Swiss-style Functionalism with Data Visualization Clarity
   - Extreme clarity through systematic hierarchy and generous whitespace
   - Data-first presentation with minimal decoration
   - Monochromatic foundation with strategic accent colors
   ============================================================================ */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #ffffff;
    color: #3c3c3c;
    line-height: 1.6;
    letter-spacing: 0.3px;
}

/* Container */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* Header */
.header {
    padding: 1rem 0 1rem 0;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.title {
    /*font-size: 2rem;*/
    font-weight: 500;
    letter-spacing: -0.5px;
    color: #1a1a1a;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.875rem;
    color: #888888;
    font-weight: 400;
    letter-spacing: 0.2px;
}

@media (max-width: 640px) {
    .title {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.8125rem;
    }
}

/* Main Content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 2rem;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5e5;
    border-top-color: #059669;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: #888888;
    font-size: 0.9375rem;
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.65rem;
}

.error-message {
    color: #dc2626;
    font-size: 0.9375rem;
    max-width: 400px;
}

.retry-button {
    padding: 0.5rem 1rem;
    background-color: #059669;
    color: white;
    border: none;
    border-radius: 0.4rem;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.retry-button:hover {
    background-color: #047857;
}

.retry-button:active {
    background-color: #065f46;
}

/* Table Wrapper */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e5e5;
    border-radius: 0.65rem;
    background-color: #ffffff;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e5e5;
}

.data-table th {
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    text-transform: uppercase;
    border: 1px solid #e5e5e5;
    width: 140px;
}

.data-table th:first-child {
    text-align: center;
    width: 100px;
}

.data-table td {
    padding: 0.3rem 1rem;
    border: 1px solid #e5e5e5;
    text-align: right;
    width: 140px;
}

.data-table td:first-child {
    text-align: center;
    font-weight: 500;
    color: #1a1a1a;
    width: 100px;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: #f3f4f6;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Number Formatting */
.data-table td.number {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
}

.data-table td.number.positive {
    color: #059669;
}

.data-table td.number.negative {
    color: #dc2626;
}

.data-table td.number.neutral {
    color: #3c3c3c;
}

.data-table td.dividend {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
}

.data-table td.dividend.positive {
    color: #059669;
}

.data-table td.dividend.negative {
    color: #dc2626;
}

/* Footer */
.footer {
    border-top: 1px solid #e5e5e5;
    background-color: #fafafa;
    padding: 1.5rem;
    margin-top: auto;
}

.footer-text {
    text-align: center;
    font-size: 0.75rem;
    color: #888888;
    letter-spacing: 0.3px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .data-table {
        font-size: 0.8125rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.625rem 0.75rem;
    }

    .data-table th {
        font-size: 0.7rem;
    }

    .header {
        padding: 1.5rem 0 1rem 0;
        margin-bottom: 1.5rem;
    }

    .main {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .data-table {
        font-size: 0.75rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }

    .data-table th {
        font-size: 0.65rem;
    }

    .title {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .header {
        padding: 1rem 0 0.75rem 0;
        margin-bottom: 1rem;
    }

    .main {
        margin-bottom: 1rem;
    }

    .footer {
        padding: 1rem;
    }

    .footer-text {
        font-size: 0.7rem;
    }
}

/* Animation for table rows */
/* @keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.data-table tbody tr {
    animation: fadeIn 0.3s ease-out;
}

.data-table tbody tr:nth-child(1) { animation-delay: 0ms; }
.data-table tbody tr:nth-child(2) { animation-delay: 30ms; }
.data-table tbody tr:nth-child(3) { animation-delay: 60ms; }
.data-table tbody tr:nth-child(4) { animation-delay: 90ms; }
.data-table tbody tr:nth-child(5) { animation-delay: 120ms; }
.data-table tbody tr:nth-child(6) { animation-delay: 150ms; }
.data-table tbody tr:nth-child(7) { animation-delay: 180ms; }
.data-table tbody tr:nth-child(8) { animation-delay: 210ms; }
.data-table tbody tr:nth-child(9) { animation-delay: 240ms; }
.data-table tbody tr:nth-child(10) { animation-delay: 270ms; }
.data-table tbody tr:nth-child(11) { animation-delay: 300ms; }
.data-table tbody tr:nth-child(12) { animation-delay: 330ms; }
.data-table tbody tr:nth-child(13) { animation-delay: 360ms; }
.data-table tbody tr:nth-child(14) { animation-delay: 390ms; }
.data-table tbody tr:nth-child(15) { animation-delay: 420ms; }
.data-table tbody tr:nth-child(16) { animation-delay: 450ms; }
.data-table tbody tr:nth-child(17) { animation-delay: 480ms; }
.data-table tbody tr:nth-child(18) { animation-delay: 510ms; }
.data-table tbody tr:nth-child(19) { animation-delay: 540ms; }
.data-table tbody tr:nth-child(20) { animation-delay: 570ms; }
.data-table tbody tr:nth-child(21) { animation-delay: 600ms; }
.data-table tbody tr:nth-child(22) { animation-delay: 630ms; } */

/* Scrollbar Styling */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}