/* static/css/undo.css */

/* ============================================
   СТИЛИ ДЛЯ СИСТЕМЫ ОТМЕНЫ ХОДОВ
   ============================================ */

/* --- ИНДИКАТОР КОЛИЧЕСТВА ХОДОВ --- */
.undo-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.undo-indicator .count {
    color: #e0e0e0;
    font-weight: bold;
    font-size: 14px;
    min-width: 20px;
    text-align: center;
}

.undo-indicator .count.active {
    color: #ffd700;
}

/* --- ИСТОРИЯ ХОДОВ В САЙДБАРЕ --- */
.move-history {
    max-height: 150px;
    overflow-y: auto;
    padding: 4px 0;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.move-history .move-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 8px;
    border-radius: 3px;
    transition: background 0.2s;
}

.move-history .move-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.move-history .move-item .move-number {
    color: #666;
    margin-right: 8px;
    min-width: 25px;
}

.move-history .move-item .move-text {
    color: #e0e0e0;
}

.move-history .move-item .move-text.white-move {
    color: #fff;
}

.move-history .move-item .move-text.black-move {
    color: #aaa;
}

.move-history .move-item .move-undo {
    color: #888;
    font-size: 10px;
    cursor: pointer;
    transition: color 0.2s;
}

.move-history .move-item .move-undo:hover {
    color: #ffd700;
}

/* --- АНИМАЦИЯ ПРИ ОТМЕНЕ --- */
@keyframes undoFlash {
    0% {
        background: rgba(255, 215, 0, 0.3);
    }
    100% {
        background: transparent;
    }
}

.move-history .move-item.undo-flash {
    animation: undoFlash 1s ease-out;
}

/* --- КНОПКА ОТМЕНЫ С КАУНТЕРОМ --- */
#undoBtn {
    position: relative;
}

#undoBtn .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ffd700;
    color: #1a1a2e;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

#undoBtn:disabled .badge {
    opacity: 0.3;
    transform: scale(0.8);
}

/* --- АДАПТИВ --- */
@media (max-width: 600px) {
    .move-history {
        max-height: 100px;
        font-size: 11px;
    }
    
    .move-history .move-item {
        padding: 1px 4px;
    }
    
    .undo-indicator {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .undo-indicator .count {
        font-size: 12px;
        min-width: 16px;
    }
}