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

body {
    font-family: 'Arial', sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    padding-bottom: 60px; /* Espacio para el ticker fijo */
}

/* Header público corregido */
.header {
    background: linear-gradient(135deg, #6B8E23, #9ACD32);
    color: white;
    padding: 12px 0; /* Padding adecuado */
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

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

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    min-height: 50px; /* Altura mínima controlada */
}

.header-logo-container {
    display: flex;
    align-items: center;
    height: 50px; /* Contenedor con altura fija */
    overflow: hidden; /* Evitar desbordamiento */
}

.header-logo {
    height: 35px !important; /* Altura fija */
    width: auto !important; /* Ancho automático para mantener proporción */
    max-width: 120px !important; /* Ancho máximo */
    object-fit: contain !important; /* Mantener proporción sin distorsión */
    display: block;
}

.header-main {
    text-align: center;
    flex-grow: 1;
}

.header h1 {
    font-size: 1.6rem;
    margin: 0 0 5px 0; /* Márgenes controlados */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0 0 3px 0; /* Márgenes controlados */
}

.demo-notice {
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 3px 0;
    font-size: 0.8rem;
    display: inline-block;
}
    font-size: 0.75rem;
    display: inline-block;
}

.last-update {
    font-size: 0.75rem;
    margin: 3px 0;
    opacity: 0.8;
}

/* Container mejorado sin romper layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Padding mínimo pero funcional */
}

/* Admin container más estrecho */
.admin-container {
    max-width: 1000px;
    margin: 10px auto;
    padding: 0 15px;
}

/* Slider */
.slider-container {
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.slider {
    height: 250px;
    position: relative;
    overflow: hidden;
}

.slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.slider img.active {
    display: block;
}

/* Layout principal corregido */
.main-layout {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 20px; /* Restaurado spacing original */
    margin: 20px 0; /* Restaurado margen original */
    padding: 0 15px; /* Padding mínimo pero funcional */
}

/* Contenido a ancho completo cuando no hay sidebars */
.main-content.full-width {
    grid-column: 1 / -1;
    max-width: none;
    margin: 0;
    padding: 0 20px;
}

/* Publicidades laterales restauradas */
.sidebar {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: none; /* Removido límite que causaba problemas */
}

.sidebar h3 {
    color: #6B8E23;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.1rem;
}

.ad-item {
    margin-bottom: 20px;
    text-align: center;
}

.ad-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.ad-item img:hover {
    transform: scale(1.05);
}

/* Contenido principal más compacto */
.main-content {
    background: white;
    border-radius: 10px; /* Reducido de 15px */
    padding: 20px; /* Reducido de 30px */
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Admin cards más compactas */
.admin-card {
    background: white;
    border-radius: 10px; /* Reducido de 15px */
    padding: 20px; /* Reducido de 30px */
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px; /* Reducido de 30px */
}

.admin-card h1, .admin-card h2 {
    font-size: 1.4rem; /* Reducido */
    margin-bottom: 15px; /* Reducido */
}

.admin-card p {
    font-size: 0.9rem; /* Reducido */
    margin-bottom: 10px;
}

/* Botones principales de tasas - centrado corregido */
.main-rates {
    display: flex;
    justify-content: center;
    align-items: stretch; /* Altura igual para todos */
    gap: 20px;
    margin: 20px auto;
    padding: 0 20px;
    flex-wrap: wrap;
    max-width: 800px; /* Limitar ancho máximo */
}

.rate-button {
    background: white;
    border: 2px solid #9ACD32;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 160px; /* Ancho fijo para mejor alineación */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rate-button:hover {
    background: #f0fff0;
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(154, 205, 50, 0.3);
}

.rate-button .currency {
    font-size: 1.2rem;
    font-weight: bold;
    color: #6B8E23;
    margin-bottom: 8px;
    text-align: center;
}

.rate-button .rate {
    font-size: 1.8rem;
    font-weight: bold;
    color: #9ACD32;
    text-align: center;
    margin-bottom: 5px;
}

.rate-button .label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    text-align: center;
}

/* Lista de plataformas */
.platforms-section {
    margin-top: 40px;
}

.platforms-section h2 {
    color: #6B8E23;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    border-bottom: 3px solid #9ACD32;
    padding-bottom: 10px;
}

.platforms-grid {
    display: grid;
    gap: 15px;
}

.platform-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px; /* Restaurado tamaño funcional */
    padding: 15px; /* Balance entre compacto y funcional */
    display: grid;
    grid-template-columns: 50px 1fr auto auto auto; /* Logo tamaño medio */
    align-items: center;
    gap: 15px; /* Gap medio */
    transition: all 0.3s ease;
    margin: 0 0 10px 0; /* Solo margen inferior */
}

.platform-item:hover {
    border-color: #9ACD32;
    background: #f0fff0;
    transform: translateX(3px);
}

.platform-logo {
    width: 45px; /* Tamaño medio entre original y muy pequeño */
    height: 45px;
    border-radius: 6px;
    object-fit: contain;
    background: white;
    padding: 4px;
}

.platform-name {
    font-weight: bold;
    color: #6B8E23;
    font-size: 1.1rem; /* Tamaño legible pero compacto */
}

.platform-rate {
    text-align: center;
    padding: 8px 12px; /* Padding medio */
    background: white;
    border-radius: 6px;
    border: 2px solid #9ACD32;
    min-width: 90px; /* Ancho funcional */
}

.platform-rate .currency-label {
    font-size: 0.9rem;
    color: #666;
    display: block;
}

.platform-rate .rate-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #6B8E23;
}

/* Ticker de mensajes */
.ticker-container {
    background: linear-gradient(90deg, #6B8E23, #9ACD32);
    color: white;
    padding: 15px 0;
    overflow: hidden;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    margin: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.ticker-content {
    white-space: nowrap;
    animation: scroll 30s linear infinite;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0 20px;
}

@keyframes scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Ajustar el body para el ticker fijo - estilos ya definidos arriba */

/* Responsive para dispositivos móviles */
@media (max-width: 768px) {
    .ticker-content {
        font-size: 0.9rem;
        font-weight: 400;
        padding: 0 15px;
    }
    
    .ticker-container {
        padding: 12px 0;
    }
    
    body {
        padding-bottom: 50px;
    }
}

@media (max-width: 480px) {
    .ticker-content {
        font-size: 0.8rem;
        padding: 0 10px;
    }
    
    .ticker-container {
        padding: 10px 0;
    }
    
    body {
        padding-bottom: 45px;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 150px 1fr 150px;
        gap: 20px;
    }
    
    .sidebar {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .main-rates {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .platform-item {
        grid-template-columns: 50px 1fr;
        gap: 15px;
        text-align: center;
    }
    
    .platform-rate {
        grid-column: 1 / -1;
        margin-top: 10px;
        justify-self: center;
    }
    
    .header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .rate-button {
        padding: 20px 15px;
    }
    
    .rate-button .currency {
        font-size: 1.2rem;
    }
    
    .rate-button .rate {
        font-size: 1.6rem;
    }
}

/* Estilos para el admin - MAS COMPACTOS */
.admin-container {
    max-width: 1000px;
    margin: 20px auto; /* Reducido de 50px */
    padding: 0 15px; /* Reducido de 20px */
}

.admin-card {
    background: white;
    border-radius: 8px; /* Reducido de 15px */
    padding: 15px; /* Reducido de 30px */
    box-shadow: 0 2px 15px rgba(0,0,0,0.1); /* Reducido shadow */
    margin-bottom: 15px; /* Reducido de 30px */
}

.admin-form {
    display: grid;
    gap: 12px; /* Reducido de 20px */
}

.form-group {
    display: grid;
    gap: 5px; /* Reducido de 8px */
    margin-bottom: 10px; /* Agregado para espaciado */
}

.form-group label {
    font-weight: bold;
    color: #6B8E23;
    font-size: 0.9rem; /* Más pequeño */
}

.form-control {
    padding: 8px 12px; /* Reducido de 12px 15px */
    border: 2px solid #e9ecef;
    border-radius: 6px; /* Reducido de 8px */
    font-size: 0.9rem; /* Reducido de 1rem */
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #9ACD32;
}

/* Botones modernos */
.btn {
    padding: 8px 16px; /* Más compacto */
    border: none;
    border-radius: 6px; /* Esquinas semi-redondas */
    cursor: pointer;
    font-size: 0.9rem; /* Más pequeño */
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #9ACD32;
    color: white;
    border: 1px solid #8FBC8F;
}

.btn-primary:hover {
    background: #6B8E23;
    border-color: #556B2F;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #c82333;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.btn-success {
    background: #28a745;
    color: white;
    border: 1px solid #1e7e34;
}

.btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
}

.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #6B8E23;
}

.table tr:hover {
    background: #f8f9fa;
}
