/**
 * Team Jerseys CSS - Sistema de Camisetas para Equipos Españoles
 * Versión: 1.0
 * Compatible con cualquier framework
 */

/* =================================================================
   VARIABLES CSS PARA CAMISETAS
   ================================================================= */
:root {
    --jersey-sm: 40px;
    --jersey-md: 60px;
    --jersey-lg: 80px;
    --jersey-xl: 100px;
    
    --jersey-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    --jersey-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.25);
    --jersey-border-radius: 8px;
    --jersey-transition: all 0.3s ease;
}

/* =================================================================
   CONTENEDORES BÁSICOS DE CAMISETAS
   ================================================================= */

.jersey-container {
    display: inline-block;
    position: relative;
    transition: var(--jersey-transition);
    border-radius: var(--jersey-border-radius);
    overflow: hidden;
}

.jersey-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--jersey-shadow-hover);
}

/* =================================================================
   TAMAÑOS DE CAMISETAS
   ================================================================= */

.jersey-sm {
    width: var(--jersey-sm);
    height: calc(var(--jersey-sm) * 1.2);
}

.jersey-md {
    width: var(--jersey-md);
    height: calc(var(--jersey-md) * 1.2);
}

.jersey-lg {
    width: var(--jersey-lg);
    height: calc(var(--jersey-lg) * 1.2);
}

.jersey-xl {
    width: var(--jersey-xl);
    height: calc(var(--jersey-xl) * 1.2);
}

/* Camiseta por defecto (news size) */
.jersey {
    width: 50px;
    height: 60px;
    display: inline-block;
    border-radius: 4px;
    box-shadow: var(--jersey-shadow);
    transition: var(--jersey-transition);
    position: relative;
    overflow: hidden;
}

.jersey svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* =================================================================
   EFECTOS HOVER Y INTERACTIVIDAD
   ================================================================= */

.jersey:hover,
.jersey-interactive:hover {
    transform: scale(1.1);
    box-shadow: var(--jersey-shadow-hover);
    z-index: 10;
}

.jersey-clickable {
    cursor: pointer;
    user-select: none;
}

.jersey-clickable:active {
    transform: scale(0.95);
}

/* =================================================================
   GRIDS PARA MOSTRAR EQUIPOS
   ================================================================= */

.jerseys-grid {
    display: grid;
    gap: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    margin: 20px 0;
}

.jerseys-grid-sm {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 15px;
}

.jerseys-grid-md {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 20px;
}

.jerseys-grid-lg {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 25px;
}

/* Grid específico para noticias */
.news-jerseys-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

/* =================================================================
   CARDS DE EQUIPOS CON CAMISETAS
   ================================================================= */

.team-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--jersey-shadow);
    transition: var(--jersey-transition);
    border: 1px solid #e2e8f0;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--jersey-shadow-hover);
    border-color: #cbd5e1;
}

.team-card .jersey {
    margin: 0 auto 15px;
    width: 60px;
    height: 72px;
}

.team-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
}

.team-card .team-division {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.team-division-1 {
    color: #dc2626;
}

.team-division-2 {
    color: #2563eb;
}

/* =================================================================
   LAYOUT RESPONSIVE
   ================================================================= */

@media (max-width: 768px) {
    .jerseys-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 15px;
    }
    
    .team-card {
        padding: 15px;
    }
    
    .team-card .jersey {
        width: 50px;
        height: 60px;
    }
    
    .team-card h3 {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .jerseys-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 10px;
    }
    
    .jersey {
        width: 40px;
        height: 48px;
    }
}

/* =================================================================
   SECCIONES DE DIVISIONES
   ================================================================= */

.division-section {
    margin: 40px 0;
}

.division-header {
    text-align: center;
    margin-bottom: 30px;
}

.division-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

.division-1 .division-title {
    color: #dc2626;
}

.division-2 .division-title {
    color: #2563eb;
}

.division-subtitle {
    font-size: 1.1rem;
    color: #64748b;
    font-weight: 500;
}

/* =================================================================
   COMPONENTES PARA NOTICIAS
   ================================================================= */

.news-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--jersey-shadow);
    border-left: 4px solid #e2e8f0;
    transition: var(--jersey-transition);
}

.news-item:hover {
    border-left-color: #3b82f6;
    box-shadow: var(--jersey-shadow-hover);
}

.news-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.news-teams {
    display: flex;
    gap: 10px;
    align-items: center;
}

.news-vs {
    font-weight: bold;
    color: #64748b;
    font-size: 0.875rem;
}

.news-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px;
    line-height: 1.4;
}

.news-summary {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 15px;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

/* =================================================================
   UTILIDADES ESPECÍFICAS PARA CAMISETAS
   ================================================================= */

.jersey-tooltip {
    position: relative;
}

.jersey-tooltip::after {
    content: attr(data-team);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.jersey-tooltip:hover::after {
    opacity: 1;
}

/* Indicadores de división */
.division-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.division-badge-1 {
    background: #dc2626;
}

.division-badge-2 {
    background: #2563eb;
}

/* =================================================================
   ANIMACIONES ESPECIALES
   ================================================================= */

@keyframes jerseyPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.jersey-featured {
    animation: jerseyPulse 2s ease-in-out infinite;
}

.jersey-loading {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =================================================================
   DARK MODE SUPPORT
   ================================================================= */

@media (prefers-color-scheme: dark) {
    .team-card {
        background: #1e293b;
        border-color: #334155;
        color: white;
    }
    
    .team-card h3 {
        color: white;
    }
    
    .news-item {
        background: #1e293b;
        border-left-color: #334155;
        color: white;
    }
    
    .news-title {
        color: white;
    }
    
    .jerseys-grid {
        background: #0f172a;
    }
}

/* =================================================================
   PRINT STYLES
   ================================================================= */

@media print {
    .jersey-container:hover,
    .jersey:hover {
        transform: none;
        box-shadow: none;
    }
    
    .jerseys-grid {
        background: transparent;
    }
    
    .team-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}