/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



/* Diseño de las 3 columnas de publicidad */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Crea 3 columnas iguales */
    gap: 20px;                             /* Espacio entre anuncios */
    margin: 20px 0;
}

.ad-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.ad-card img {
    width: 100%;       /* Hace que la imagen ocupe todo el ancho de la columna */
    height: auto;
    display: block;
}

/* En celulares, se pone un anuncio debajo de otro */
@media (max-width: 768px) {
    .ads-grid {
        grid-template-columns: 1fr;
    }
}







/* Diseño de las 3 columnas de publicidad */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Crea 3 columnas iguales */
    gap: 20px;                             /* Espacio entre anuncios */
    margin: 20px 0;
}

.ad-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.ad-card img {
    width: 100%;       /* Hace que la imagen ocupe todo el ancho de la columna */
    height: auto;
    display: block;
}

/* En celulares, se pone un anuncio debajo de otro */
@media (max-width: 768px) {
    .ads-grid {
        grid-template-columns: 1fr;
    }
}






body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FF8C00 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: #1a1a1a;
}

header h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 15px;
}

.last-update {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* Indicador de estado */
.status-indicator {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.status-indicator.success {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.status-indicator.error {
    background: rgba(244, 67, 54, 0.1);
    color: #c62828;
    border: 2px solid #f44336;
}

/* Tarjetas de tasas */
.rate-card {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.main-rate {
    margin-bottom: 30px;
}

.rate-card.main {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,215,0,0.2) 100%);
    border: 3px solid #FFD700;
    text-align: center;
}

.rate-card h2 {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 15px;
    font-weight: bold;
}

.rate-card h3 {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rate-value {
    font-size: 3.5rem;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}

.rate-value.small {
    font-size: 2.5rem;
    justify-content: flex-start;
}

.currency {
    font-size: 0.7em;
    opacity: 0.7;
}

.symbol {
    font-size: 0.4em;
    background: #FFD700;
    color: #1a1a1a;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
}

.rate-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 1rem;
    font-weight: bold;
}

.rate-change.positive {
    color: #4caf50;
}

.rate-change.negative {
    color: #f44336;
}

.rate-source {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

/* Grid de tasas */
.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Calculadora */
.calculator {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.calculator h3 {
    margin-bottom: 20px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calc-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.calc-input input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

.calc-input input:focus {
    outline: none;
    border-color: #FFD700;
}

.calc-input button {
    padding: 12px 24px;
    background: #FFD700;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.calc-input button:hover {
    background: #FFA500;
}

.calc-result {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1a1a1a;
    padding: 15px;
    background: rgba(255,215,0,0.2);
    border-radius: 8px;
    text-align: center;
}

/* Historial */
.history-section {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.history-section h3 {
    margin-bottom: 20px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.export-btn, .clear-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.export-btn {
    background: #4caf50;
    color: white;
}

.export-btn:hover {
    background: #45a049;
}

.clear-btn {
    background: #f44336;
    color: white;
}

.clear-btn:hover {
    background: #da190b;
}

.history-chart {
    min-height: 200px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 50px;
}

.history-table {
    overflow-x: auto;
}

.history-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th,
.history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.history-table th {
    background: #f5f5f5;
    font-weight: bold;
    color: #1a1a1a;
}

.history-table tr:hover {
    background: rgba(255,215,0,0.1);
}

/* Sección de compartir */
.share-section {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.share-section h3 {
    margin-bottom: 20px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.share-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.whatsapp {
    background: #25D366;
}

.telegram {
    background: #0088cc;
}

.twitter {
    background: #1DA1F2;
}

.copy {
    background: #6c757d;
}

.image {
    background: #ff6b6b;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    color: #1a1a1a;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

footer p {
    margin-bottom: 10px;
}

.disclaimer {
    font-size: 0.9rem;
    opacity: 0.8;
    font-style: italic;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: bold;
    margin: 0 5px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #FF8C00;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .rate-value {
        font-size: 2.5rem;
    }
    
    .rate-value.small {
        font-size: 2rem;
    }
    
    .rates-grid {
        grid-template-columns: 1fr;
    }
    
    .calc-input {
        flex-direction: column;
    }
    
    .calc-input input {
        min-width: auto;
    }
    
    .share-buttons {
        justify-content: stretch;
    }
    
    .share-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .rate-value {
        font-size: 2rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .rate-value.small {
        font-size: 1.8rem;
    }
    
    .symbol {
        font-size: 0.6em;
    }
}

/* Animaciones */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.rate-card.updating {
    animation: pulse 2s infinite;
}

/* Loading spinner */
.fa-spin {
    animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,215,0,0.7);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,215,0,0.9);
}