/* ========================================
   Theme Toggle Button - Realistic Mushroom Design
   Botón flotante con diseño de hongo realista
   ======================================== */

.theme-toggle {
    position: fixed;
    top: 100px;
    right: 30px;
    z-index: 9999;
    cursor: pointer;
    transition: var(--transition-normal);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

.mushroom-button {
    position: relative;
    width: 80px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mushroom-button:hover {
    transform: scale(1.15) rotate(-3deg);
}

.mushroom-button:active {
    transform: scale(0.92) rotate(2deg);
}

/* Sombrero del hongo - más realista */
.mushroom-cap {
    width: 70px;
    height: 45px;
    background: radial-gradient(ellipse at 30% 30%, 
                rgba(255, 255, 255, 0.3) 0%, 
                transparent 50%),
                linear-gradient(135deg, #b565ed 0%, #9d4edd 50%, #7c3aed 100%);
    border-radius: 50% 50% 50% 50% / 100% 100% 0% 0%;
    position: relative;
    box-shadow: 
        0 8px 25px rgba(157, 78, 221, 0.6),
        inset 0 -5px 15px rgba(0, 0, 0, 0.3),
        inset 0 3px 8px rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
}

/* Brillo superior del sombrero */
.mushroom-cap::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 15px;
    width: 25px;
    height: 15px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    transform: rotate(-20deg);
}

/* Manchas decorativas del hongo - más realistas */
.mushroom-cap::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: 
        radial-gradient(circle at 25% 35%, rgba(255, 255, 255, 0.4) 0%, transparent 8px),
        radial-gradient(circle at 60% 25%, rgba(255, 255, 255, 0.35) 0%, transparent 6px),
        radial-gradient(circle at 70% 50%, rgba(255, 255, 255, 0.3) 0%, transparent 5px),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.25) 0%, transparent 7px),
        radial-gradient(circle at 15% 65%, rgba(255, 255, 255, 0.3) 0%, transparent 4px);
    border-radius: inherit;
}

/* Láminas debajo del sombrero */
.mushroom-cap .gills {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        rgba(120, 80, 180, 0.6) 0px,
        rgba(120, 80, 180, 0.4) 1px,
        transparent 1px,
        transparent 3px
    );
    border-radius: 0 0 50% 50%;
    opacity: 0.7;
}

/* Tallo del hongo - más realista con textura */
.mushroom-stem {
    width: 28px;
    height: 38px;
    background: 
        linear-gradient(90deg, 
            rgba(255, 255, 255, 0) 0%, 
            rgba(255, 255, 255, 0.4) 50%, 
            rgba(255, 255, 255, 0) 100%),
        linear-gradient(180deg, 
            #f5f5f5 0%, 
            #e8e8e8 50%, 
            #d4d4d4 100%);
    border-radius: 0 0 45% 45%;
    margin-top: -3px;
    box-shadow: 
        inset -3px 0 8px rgba(0, 0, 0, 0.15),
        inset 3px 0 8px rgba(255, 255, 255, 0.3),
        0 5px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: all 0.3s ease;
}

/* Anillo del tallo */
.mushroom-stem::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 6px;
    background: linear-gradient(180deg, 
                rgba(230, 230, 230, 0.9) 0%, 
                rgba(200, 200, 200, 0.7) 100%);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Textura del tallo */
.mushroom-stem::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        rgba(0, 0, 0, 0.03) 2px,
        transparent 4px
    );
    border-radius: inherit;
}

/* Base del hongo */
.mushroom-base {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 8px;
    background: radial-gradient(ellipse, 
                rgba(100, 100, 100, 0.4) 0%, 
                transparent 70%);
    border-radius: 50%;
    filter: blur(2px);
}

/* Indicador de tema actual */
.theme-indicator {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.theme-toggle:hover .theme-indicator {
    opacity: 1;
}

/* Animación de pulso */
@keyframes mushroom-pulse {
    0%, 100% {
        box-shadow: 0 5px 20px rgba(157, 78, 221, 0.5);
    }
    50% {
        box-shadow: 0 5px 30px rgba(157, 78, 221, 0.8);
    }
}

.mushroom-cap {
    animation: mushroom-pulse 3s ease-in-out infinite;
}

/* Tema gótico activo - Hongo oscuro realista */
body.theme-gothic .mushroom-cap {
    background: radial-gradient(ellipse at 30% 30%, 
                rgba(255, 50, 50, 0.3) 0%, 
                transparent 50%),
                linear-gradient(135deg, #a00000 0%, #8b0000 50%, #6b0000 100%);
    box-shadow: 
        0 8px 25px rgba(139, 0, 0, 0.7),
        inset 0 -5px 15px rgba(0, 0, 0, 0.5),
        inset 0 3px 8px rgba(255, 50, 50, 0.2);
}

body.theme-gothic .mushroom-cap::before {
    background: radial-gradient(ellipse, rgba(255, 100, 100, 0.5) 0%, transparent 70%);
}

body.theme-gothic .mushroom-cap::after {
    background: 
        radial-gradient(circle at 25% 35%, rgba(192, 192, 192, 0.5) 0%, transparent 8px),
        radial-gradient(circle at 60% 25%, rgba(192, 192, 192, 0.4) 0%, transparent 6px),
        radial-gradient(circle at 70% 50%, rgba(192, 192, 192, 0.35) 0%, transparent 5px),
        radial-gradient(circle at 40% 60%, rgba(192, 192, 192, 0.3) 0%, transparent 7px),
        radial-gradient(circle at 15% 65%, rgba(192, 192, 192, 0.35) 0%, transparent 4px);
}

body.theme-gothic .mushroom-cap .gills {
    background: repeating-linear-gradient(
        90deg,
        rgba(100, 0, 0, 0.7) 0px,
        rgba(100, 0, 0, 0.5) 1px,
        transparent 1px,
        transparent 3px
    );
}

body.theme-gothic .mushroom-stem {
    background: 
        linear-gradient(90deg, 
            rgba(255, 255, 255, 0) 0%, 
            rgba(80, 80, 80, 0.3) 50%, 
            rgba(255, 255, 255, 0) 100%),
        linear-gradient(180deg, 
            #3a3a3a 0%, 
            #2a2a2a 50%, 
            #1a1a1a 100%);
    box-shadow: 
        inset -3px 0 8px rgba(0, 0, 0, 0.4),
        inset 3px 0 8px rgba(100, 100, 100, 0.2),
        0 5px 10px rgba(0, 0, 0, 0.4);
}

body.theme-gothic .mushroom-stem::before {
    background: linear-gradient(180deg, 
                rgba(60, 60, 60, 0.9) 0%, 
                rgba(40, 40, 40, 0.7) 100%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

@keyframes mushroom-pulse-gothic {
    0%, 100% {
        box-shadow: 
            0 8px 25px rgba(139, 0, 0, 0.7),
            inset 0 -5px 15px rgba(0, 0, 0, 0.5),
            inset 0 3px 8px rgba(255, 50, 50, 0.2);
    }
    50% {
        box-shadow: 
            0 8px 35px rgba(139, 0, 0, 1),
            inset 0 -5px 15px rgba(0, 0, 0, 0.5),
            inset 0 3px 8px rgba(255, 50, 50, 0.3);
    }
}

body.theme-gothic .mushroom-cap {
    animation: mushroom-pulse-gothic 3s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .theme-toggle {
        top: 80px;
        right: 20px;
    }
    
    .mushroom-button {
        width: 60px;
        height: 70px;
    }
    
    .mushroom-cap {
        width: 50px;
        height: 35px;
    }
    
    .mushroom-stem {
        width: 22px;
        height: 30px;
    }
}

@media (max-width: 480px) {
    .theme-toggle {
        top: 70px;
        right: 15px;
    }
    
    .mushroom-button {
        width: 50px;
        height: 60px;
    }
    
    .mushroom-cap {
        width: 45px;
        height: 30px;
    }
    
    .mushroom-cap::before {
        width: 10px;
        height: 10px;
        top: 6px;
        left: 10px;
    }
    
    .mushroom-cap::after {
        width: 7px;
        height: 7px;
        top: 12px;
        right: 12px;
    }
    
    .mushroom-stem {
        width: 20px;
        height: 25px;
    }
}
