/* ✨ Visual Cooldown Enhancement System */

/* Base cooldown overlay container */
.cooldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 4px;
    overflow: hidden;
}

/* Pie chart countdown visual */
.cooldown-pie {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(
        from 270deg,
        rgba(231, 76, 60, 0.7) 0deg,
        rgba(231, 76, 60, 0.7) var(--progress, 0deg),
        transparent var(--progress, 0deg),
        transparent 360deg
    );
    border-radius: 4px;
    transition: --progress 0.1s linear;
}

/* Pulse animation during cooldown */
.cooldown-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(231, 76, 60, 0.2);
    border-radius: 4px;
    animation: cooldownPulse 2s ease-in-out infinite;
}

@keyframes cooldownPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.4; }
}

/* Ready state - sparkling glow effect */
.skill-ready {
    position: relative;
    animation: skillReadyGlow 1.5s ease-out;
}

.skill-ready::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        #27ae60, #2ecc71, #f1c40f, #27ae60, 
        #2ecc71, #f1c40f, #27ae60);
    background-size: 400% 400%;
    border-radius: 6px;
    z-index: -1;
    animation: skillReadySpark 1.5s ease-out;
}

@keyframes skillReadyGlow {
    0% {
        box-shadow: 0 0 10px rgba(39, 174, 96, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px rgba(39, 174, 96, 1);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 5px rgba(39, 174, 96, 0.4);
        transform: scale(1);
    }
}

@keyframes skillReadySpark {
    0% {
        background-position: 0% 50%;
        opacity: 0.8;
    }
    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
    100% {
        background-position: 200% 50%;
        opacity: 0;
    }
}

/* Enhanced cooldown number display */
.shortcut-cooldown {
    position: absolute;
    top: 1px;
    right: 1px;
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
    font-size: 0.6em;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: bold;
    border: 1px solid #922b21;
    z-index: 10;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
    animation: cooldownNumberPulse 1s ease-in-out infinite;
}

@keyframes cooldownNumberPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Different time unit indicators */
.shortcut-cooldown.seconds {
    background: linear-gradient(145deg, #f39c12, #e67e22);
    border-color: #d68910;
}

.shortcut-cooldown.rounds {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    border-color: #922b21;
}

/* Last second warning */
.shortcut-cooldown.urgent {
    background: linear-gradient(145deg, #ff4757, #ff3742);
    animation: urgentFlash 0.5s ease-in-out infinite;
}

@keyframes urgentFlash {
    0%, 100% { 
        background: linear-gradient(145deg, #ff4757, #ff3742);
        transform: scale(1);
    }
    50% { 
        background: linear-gradient(145deg, #ffa502, #ff6348);
        transform: scale(1.15);
    }
}

/* Smoother transitions for existing elements */
.shortcut-slot {
    transition: all 0.3s ease;
}

.shortcut-slot.cooldown {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(145deg, #5d4e75, #2c3e50) !important;
    border-color: #8e44ad !important;
    transition: all 0.3s ease;
}

.shortcut-slot.cooldown:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Ready indicator for small screens */
@media (max-width: 768px) {
    .skill-ready::before {
        top: -1px;
        left: -1px;
        right: -1px;
        bottom: -1px;
    }
    
    @keyframes skillReadyGlow {
        0% {
            box-shadow: 0 0 5px rgba(39, 174, 96, 0.8);
            transform: scale(1);
        }
        50% {
            box-shadow: 0 0 15px rgba(39, 174, 96, 1);
            transform: scale(1.03);
        }
        100% {
            box-shadow: 0 0 3px rgba(39, 174, 96, 0.4);
            transform: scale(1);
        }
    }
}
