/**
 * Tema específico para Mercería
 * Colores, tipografías y elementos visuales personalizados
 */

:root {
    /* Color corporativo principal */
    --color-corporativo: #43b5ae;
    --color-corporativo-dark: #3a9d97;
    --color-corporativo-light: #5bc4bd;
    --color-corporativo-pale: #e8f6f5;
    
    /* Colores principales de la mercería basados en el corporativo */
    --color-costura: #e74c3c;
    --color-costura-dark: #c0392b;
    --color-ganchillo: #43b5ae; /* Usar color corporativo */
    --color-ganchillo-dark: #3a9d97;
    --color-bordado: #9b59b6;
    --color-bordado-dark: #8e44ad;
    --color-punto: #27ae60;
    --color-punto-dark: #229954;
    --color-especial: #f39c12;
    --color-especial-dark: #e67e22;
    
    /* Colores de niveles con toques corporativos */
    --color-principiante: #2ecc71;
    --color-intermedio: #f39c12;
    --color-avanzado: #e74c3c;
    --color-todos: #43b5ae; /* Color corporativo */
    --color-multinivel: #9b59b6;
    
    /* Gradientes basados en color corporativo */
    --gradient-merceria: linear-gradient(135deg, #43b5ae 0%, #3a9d97 100%);
    --gradient-warm: linear-gradient(135deg, #43b5ae 0%, #5bc4bd 50%, #e8f6f5 100%);
    --gradient-craft: linear-gradient(135deg, #e8f6f5 0%, #d4ede8 100%);
    
    /* Sombras suaves */
    --shadow-soft: 0 4px 20px rgba(67, 181, 174, 0.08);
    --shadow-medium: 0 8px 25px rgba(67, 181, 174, 0.12);
    --shadow-strong: 0 15px 35px rgba(67, 181, 174, 0.15);
}

/* ===== AJUSTES ESPECÍFICOS PARA MERCERÍA ===== */

/* Header personalizado */
.calendar-header {
    background: var(--gradient-merceria);
    position: relative;
}

.calendar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--color-corporativo) 0%, 
        var(--color-costura) 25%, 
        var(--color-bordado) 50%, 
        var(--color-punto) 75%, 
        var(--color-especial) 100%);
}

/* Iconos de marca más atractivos */
.brand-icon {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255,255,255,0.2);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Títulos con mejor tipografía */
.brand-title {
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-style: italic;
    letter-spacing: 1px;
}

/* ===== CLASES CON COLORES ESPECÍFICOS ===== */

/* Costura - Rojo elegante */
.clase-costura, .legend-color.clase-costura {
    background: linear-gradient(135deg, var(--color-costura) 0%, var(--color-costura-dark) 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.clase-costura:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    transform: translateY(-3px) scale(1.02);
}

/* Ganchillo - Azul sereno */
.clase-ganchillo, .legend-color.clase-ganchillo {
    background: linear-gradient(135deg, var(--color-ganchillo) 0%, var(--color-ganchillo-dark) 100%);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.clase-ganchillo:hover {
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    transform: translateY(-3px) scale(1.02);
}

/* Bordado - Morado artístico */
.clase-bordado, .legend-color.clase-bordado {
    background: linear-gradient(135deg, var(--color-bordado) 0%, var(--color-bordado-dark) 100%);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.clase-bordado:hover {
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
    transform: translateY(-3px) scale(1.02);
}

/* Punto - Verde natural */
.clase-punto, .legend-color.clase-punto {
    background: linear-gradient(135deg, var(--color-punto) 0%, var(--color-punto-dark) 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.clase-punto:hover {
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
    transform: translateY(-3px) scale(1.02);
}

/* Especial - Naranja vibrante */
.clase-especial, .legend-color.clase-especial {
    background: linear-gradient(135deg, var(--color-especial) 0%, var(--color-especial-dark) 100%);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
}

.clase-especial:hover {
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
    transform: translateY(-3px) scale(1.02);
}

/* ===== EFECTOS ESPECIALES PARA CLASES ===== */

/* Efecto de brillo para clases populares */
.clase-item::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.clase-item:hover::after {
    opacity: 1;
}

/* Animación para clases con pocas plazas */
.clase-pocas-plazas {
    position: relative;
    overflow: hidden;
}

.clase-pocas-plazas::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(243, 156, 18, 0.3), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== MEJORAS EN LA LEYENDA ===== */
.legend-section {
    background: var(--gradient-craft);
    border-top: 3px solid rgba(102, 126, 234, 0.2);
}

.legend-item {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.legend-item:hover {
    background: rgba(255,255,255,0.95);
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-medium);
}

.legend-color {
    position: relative;
    overflow: hidden;
}

.legend-color::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.legend-item:hover .legend-color::after {
    width: 100%;
    height: 100%;
}

/* ===== MODAL MEJORADO ===== */
.modal-content {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
}

.modal-header {
    background: var(--gradient-merceria);
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--color-corporativo) 0%, 
        var(--color-costura) 33%, 
        var(--color-bordado) 66%, 
        var(--color-punto) 100%);
}

/* Estilos para detalles de clase en modal */
.detalle-item {
    padding: 12px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    border-left: 4px solid var(--color-ganchillo);
    transition: all 0.3s ease;
}

.detalle-item:hover {
    background: rgba(255,255,255,0.9);
    transform: translateX(5px);
}

/* ===== DÍAS ESPECIALES ===== */
.today {
    background: var(--gradient-warm);
    color: #2c3e50;
    position: relative;
    overflow: hidden;
}

.today::before {
    content: '✨';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.today .day-number {
    color: #2c3e50;
    font-weight: 800;
    text-shadow: none;
}

/* ===== FOOTER CON ESTILO DE MERCERÍA ===== */
.calendar-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    position: relative;
}

.calendar-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--color-corporativo) 0%, 
        var(--color-costura) 25%, 
        var(--color-bordado) 50%, 
        var(--color-punto) 75%, 
        var(--color-especial) 100%);
}

.contact-item {
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

.contact-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.contact-link {
    color: #74b9ff;
    position: relative;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #74b9ff;
    transition: width 0.3s ease;
}

.contact-link:hover::after {
    width: 100%;
}

/* ===== ANIMACIONES ADICIONALES ===== */
.calendar-container {
    animation: slideInUp 0.6s ease-out;
}

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

/* Animación de entrada para las clases */
.clase-item {
    animation: fadeInClass 0.4s ease-out;
    animation-fill-mode: both;
}

@keyframes fadeInClass {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Delay progresivo para las clases */
.clase-item:nth-child(1) { animation-delay: 0.1s; }
.clase-item:nth-child(2) { animation-delay: 0.2s; }
.clase-item:nth-child(3) { animation-delay: 0.3s; }

/* ===== RESPONSIVE ESPECÍFICO PARA MERCERÍA ===== */
@media (max-width: 768px) {
    .brand-icon {
        font-size: 1.8rem;
        padding: 8px;
    }
    
    .legend-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .detalle-item {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .calendar-header::after,
    .modal-header::after,
    .calendar-footer::before {
        height: 2px;
    }
    
    .brand-title {
        font-size: 1.2rem;
    }
    
    .brand-subtitle {
        font-size: 0.8rem;
    }
}

/* ===== MODO IMPRESIÓN ===== */
@media print {
    .calendar-container {
        box-shadow: none;
        border: 2px solid #ddd;
    }
    
    .calendar-header {
        background: #f8f9fa !important;
        color: #2c3e50 !important;
    }
    
    .clase-item {
        background: #f8f9fa !important;
        color: #2c3e50 !important;
        border: 1px solid #ddd !important;
    }
    
    .modal-overlay {
        display: none !important;
    }
}