/* Variables CSS para colores y gradientes */
:root {
    --gradient-primary: linear-gradient(135deg, var(--rx-color1) 0%,  var(--rx-color2) 100%);
    --gradient-success: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    --gradient-warning: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    --gradient-info: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    --gradient-danger: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    --shadow-soft: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
}

/* Layout principal */
.dashboard-full-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Header del dashboard */
.dashboard-header {
    background: var(--gradient-primary);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Selector de período */
.period-selector {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.period-btn {
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 6px 12px;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.875rem;
}

.period-btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.period-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Cards principales */
.kpi-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: var(--shadow-soft);
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.metric-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: var(--shadow-soft);
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Iconos de KPI */
.kpi-icon {
    opacity: 0.1;
    font-size: 3rem;
}

/* Indicadores de tendencia */
.trend-indicator {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.text-success .trend-indicator {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.text-danger .trend-indicator {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.text-muted .trend-indicator {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Datos en listas */
.data-list {
    max-height: 250px;
    overflow-y: auto;
}

.data-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.data-item:last-child {
    border-bottom: none;
}

.list-header {
    background: rgba(102, 126, 234, 0.1);
    padding: 8px 12px;
    margin: -15px -15px 15px -15px;
    border-radius: 8px 8px 0 0;
}

/* Progress bars mini */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Comparación y análisis */
.comparison-section {
    background: rgba(0, 0, 0, 0.02);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
}

.comparison-box {
    background: rgba(0, 0, 0, 0.02);
    padding: 12px;
    border-radius: 8px;
}

.trend-box {
    background: rgba(0, 0, 0, 0.02);
    padding: 12px;
    border-radius: 8px;
}

/* Badges de tendencia */
.trend-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
}

/* Chart containers */
.chart-mini {
    height: 100px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #dee2e6;
}

/* Info grid para metadatos */
.info-grid .info-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-grid .info-item:last-child {
    border-bottom: none;
}

/* Floating Action Button */
.fab {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.fab:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Loading states */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Gradientes para backgrounds */
.bg-gradient {
    background: var(--gradient-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-full-container {
        padding: 10px;
    }
    
    .dashboard-header {
        text-align: center;
    }
    
    .period-selector {
        margin-top: 15px;
    }
    
    .kpi-value {
        font-size: 1.5rem !important;
    }
    
    .display-3 {
        font-size: 2.5rem;
    }
}

@media (max-width: 576px) {
    .period-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .fab {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    .dashboard-full-container {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        color: #ffffff;
    }
    
    .card {
        background-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    

}

/* Scrollbar personalizado */
.data-list::-webkit-scrollbar {
    width: 4px;
}

.data-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.data-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.data-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Efectos hover adicionales */
.dropdown-toggle:hover {
    background-color: rgba(0, 123, 255, 0.1) !important;
}

.alert {
    border: none;
    box-shadow: var(--shadow-soft);
}

/* Utilities adicionales */
.opacity-10 {
    opacity: 0.1;
}

.opacity-25 {
    opacity: 0.25;
}

.rounded {
    border-radius: 15px !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* Estados de botones */
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-primary:hover {
    background: var(--gradient-primary);
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Transiciones globales */
* {
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, 
                border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* === ESTILOS PARA DISEÑO TIPO PODIO === */

/* Contenedor del podio */
.podium-list {
    padding: 0;
}

/* Item del podio */
.podium-item {
    border: 1px solid transparent;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
}

.podium-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Estilos específicos por posición */
.podium-first {
    background: linear-gradient(135deg, #fff9c4 0%, #fff3cd 100%);
    border-left: 4px solid #FFD700;
}

.podium-first:hover {
    background: linear-gradient(135deg, #fff7b3 0%, #fff0b8 100%);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.podium-second {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #C0C0C0;
}

.podium-second:hover {
    background: linear-gradient(135deg, #f1f3f4 0%, #dee2e6 100%);
    box-shadow: 0 6px 20px rgba(192, 192, 192, 0.3);
}

.podium-third {
    background: linear-gradient(135deg, #fdf2e9 0%, #f4e6d7 100%);
    border-left: 4px solid #CD7F32;
}

.podium-third:hover {
    background: linear-gradient(135deg, #fbeee3 0%, #f0dcc9 100%);
    box-shadow: 0 6px 20px rgba(205, 127, 50, 0.3);
}

.podium-other {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
    border-left: 4px solid #6c757d;
}

.podium-other:hover {
    background: linear-gradient(135deg, #f0f2f3 0%, #e9ecef 100%);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.2);
}

/* Posición badge */
.podium-position .badge {
    font-size: 0.875rem;
    padding: 8px 12px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Contenido del podio */
.podium-content {
    min-width: 0; /* Para permitir text-truncate */
}

.podium-content .min-width-0 {
    min-width: 0;
}

.podium-content .text-small {
    font-size: 0.75rem;
    align-items: center;
}

.podium-content .badge-sm {
    font-size: 0.65rem;
    padding: 2px 6px;
}

.podium-item .font-weight-medium {
    font-weight: 500;
    color: #495057;
}

.podium-item .text-primary {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Animaciones para el podio */
.podium-item:nth-child(1) {
    animation: slideInUp 0.6s ease-out 0.1s both;
}

.podium-item:nth-child(2) {
    animation: slideInUp 0.6s ease-out 0.2s both;
}

.podium-item:nth-child(3) {
    animation: slideInUp 0.6s ease-out 0.3s both;
}

.podium-item:nth-child(4) {
    animation: slideInUp 0.6s ease-out 0.4s both;
}

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