:root {
    --bg-color: #0b0f19;
    --surface-color: #151b2b;
    --surface-hover: #1e2638;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #2a3441;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --radius: 16px;
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1280px;
}

header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem 2rem;
    background-color: var(--surface-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

#last-updated {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#last-updated::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background-color: var(--surface-hover);
    color: var(--text-primary);
    font-family: inherit;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #4f8df7, #336eef);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(1);
    box-shadow: none;
    transform: none !important;
}

.state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    background-color: var(--surface-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    min-height: 400px;
    animation: fadeIn 0.3s ease-out;
}

.state-container h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.state-container p {
    color: var(--text-secondary);
    max-width: 400px;
}

.hidden {
    display: none !important;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.error-icon {
    background-color: rgba(239, 68, 68, 0.1);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

#retry-btn {
    margin-top: 1.5rem;
}

.table-container {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.4s ease-out;
    overflow: hidden;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.table-scroll::-webkit-scrollbar {
    height: 8px;
}

.table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.table-scroll::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

th, td {
    padding: 1.25rem 1.5rem;
}

th {
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: #e2e8f0;
}

tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: var(--surface-hover);
}

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

.empty-state {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-secondary) !important;
    font-style: italic;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .actions {
        width: 100%;
    }
    
    #download-btn {
        width: 100%;
    }
}
