:root {
    --bg-surface: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    --accent: #f59e0b;
    --success: #10b981;
    --border-color: #f3f4f6;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --font-mono: 'JetBrains Mono', 'Roboto Mono', monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-surface: #111827;
        --text-primary: #f9fa7b;
        /* Slight tint for comfort */
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-tertiary: #6b7280;
        --border-color: #1f2937;
        --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    }
}

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

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: transparent;
    display: block;
    margin: 0;
    padding: 2px;
    /* Small safety margin */
    width: 100%;
}

#widget-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    box-shadow: var(--card-shadow);
    position: relative;
    transition: all 0.2s ease;
}

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

.currency-pair {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-text {
    font-size: 10px;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--success);
    border-radius: 50%;
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

#price-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.price-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.row-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.row-currency {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 4px;
}

.last-updated {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.brand {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    opacity: 0.9;
}

.brand:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Loader */
.loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

#widget-container.loading .price-row,
#widget-container.loading .header,
#widget-container.loading .footer {
    opacity: 0.3;
}

#widget-container.loading .loader {
    display: block;
}

.hidden {
    display: none;
}