* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #000000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px 0;
}

.header-logo {
    display: inline-block;
    margin-bottom: 20px;
}

.header-logo img {
    display: block;
    margin: 0 auto;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(76, 175, 80, 0.3));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.header-date {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 10px;
}

.timestamp {
    font-size: 0.95rem;
    opacity: 0.5;
    margin-top: 4px;
}

.cards-section {
    position: relative;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.cards-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1100px) {
    .cards-container {
        grid-template-columns: repeat(3, minmax(280px, 1fr));
    }
}

.cards-container--euro {
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .cards-container--euro {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1100px) {
    .cards-container--euro {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
        max-width: 600px;
    }
}

.card {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.variation-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    white-space: nowrap;
}

.variation-up {
    background: rgba(72, 187, 120, 0.18);
    color: #48bb78;
}

.variation-down {
    background: rgba(245, 101, 101, 0.18);
    color: #f56565;
}

.card-icon {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-icon .usdt-icon {
    width: 24px;
    height: 24px;
    display: block;
}

.exchange-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 4px;
}

.card-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}

.card-label {
    font-size: 0.85rem;
    color: #cbd5e0;
}

.card-gap {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    color: #cbd5e0;
}

.gap-value {
    color: #f56565;
    font-weight: 600;
}

.oficial {
    border-top: 4px solid #48bb78;
}

.paralelo {
    border-top: 4px solid #ed8936;
}

.binance {
    border-top: 4px solid #F0B90B;
}

.euro-oficial {
    border-top: 4px solid #4299e1;
}

.euro-paralelo {
    border-top: 4px solid #9f7aea;
}

.loading {
    text-align: center;
    font-weight: 500;
    color: #cbd5e0;
}

.error {
    text-align: center;
    font-weight: 500;
    color: #f56565;
}

.error small {
    display: block;
    margin-top: 8px;
    color: #cbd5e0;
    opacity: 0.9;
}

.refresh-btn {
    display: block;
    margin: 30px auto 0;
    padding: 12px 30px;
    background: #2a2a2a;
    color: #e2e8f0;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.refresh-icon {
    display: inline-block;
    margin-right: 8px;
}

.refresh-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.refresh-btn:active {
    transform: scale(0.98);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.auto-refresh-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.7;
    color: #e2e8f0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
}

.auto-refresh-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.auto-refresh-btn.spinning {
    animation: spin 1s linear infinite;
}

.exchanges-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.chart-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.chart-section.hidden {
    display: none;
}

.toggle-chart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #2a2a2a;
    color: #e2e8f0;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.top-actions {
    display: flex;
    justify-content: flex-start;
    margin: 10px auto 10px;
    max-width: 900px;
}

@media (min-width: 1100px) {
    .top-actions {
        margin: 10px auto 10px;
    }
}

.toggle-chart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.chart-title {
    text-align: center;
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.chart-title-spaced {
    margin-top: 30px;
}

.chart-loading {
    text-align: center;
    color: #cbd5e0;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.chart-loading.hidden {
    display: none;
}

.chart-wrapper {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    height: 320px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.exchanges-title {
    text-align: center;
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.exchanges-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.exchanges-table thead {
    background: #2a2a2a;
}

.exchanges-table th {
    padding: 12px 15px;
    text-align: left;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.9rem;
}

.sort-btn {
    background: none;
    border: none;
    color: #cbd5e0;
    font-size: 0.8rem;
    margin-left: 6px;
    cursor: pointer;
    padding: 0;
    vertical-align: middle;
    opacity: 0.8;
}

.sort-btn:hover {
    opacity: 1;
}

.sort-btn.active {
    color: #ffffff;
    opacity: 1;
}

.exchanges-table td {
    padding: 10px 15px;
    color: #cbd5e0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.exchanges-table tbody tr:hover {
    background: #242424;
}

.exchange-name {
    font-weight: 500;
    color: #e2e8f0;
}

.exchange-bid {
    color: #48bb78;
}

.exchange-ask {
    color: #ed8936;
}

.exchange-variation {
    font-size: 0.7rem;
    margin-left: 6px;
}

.exchange-variation--up {
    color: #48bb78;
}

.exchange-variation--down {
    color: #f56565;
}

.exchange-variation--flat {
    color: #cbd5e0;
}

.table-message {
    text-align: center;
    color: #cbd5e0;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: auto;
    padding: 20px 0;
}

footer a {
    color: white;
    text-decoration: underline;
}
