/* ============================================================
   player-panel.css — Player panel, stats, action buttons,
   territory search, progress bar, timer circle, guide tooltips
   ============================================================ */

/* BOTÃO MUTE - Player Panel */
.mute-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 18px;
    flex-shrink: 0;
}

.mute-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* PLAYER PANEL - ESTILO JOGO MODERNO */
#player-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(10, 10, 30, 0.95);
    border-bottom: 1px solid rgba(240, 192, 64, 0.3);
    padding: 8px 15px;
    z-index: 999 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 44px;
    min-height: 44px !important;
    transform: none !important;
}

/* BUSCA DE TERRITORIO */
#territory-search {
    position: relative;
}

#search-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 18px;
    color: #f0c040;
}

#search-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

#search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 8px;
    z-index: 100;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#search-dropdown.open {
    display: block;
}

#territory-search-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    padding: 8px 10px;
    width: 100%;
    outline: none;
    box-sizing: border-box;
}

#territory-search-input:focus {
    border-color: rgba(240, 192, 64, 0.5);
}

/* BARRA DE PROGRESSO DA ACAO */
#action-progress-bar {
    position: fixed;
    top: 45px;
    left: 0;
    right: 0;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 16;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

#action-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f0c040, #e07020);
    box-shadow: 0 0 10px rgba(240, 192, 64, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.3);
    transition: width 0.3s ease;
    animation: progressPulse 1s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        filter: hue-rotate(0deg) brightness(1);
        box-shadow: 0 0 10px rgba(240, 192, 64, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.3);
    }
    50% {
        filter: hue-rotate(60deg) brightness(1.2);
        box-shadow: 0 0 20px rgba(240, 192, 64, 1), 0 0 0 2px rgba(255, 255, 255, 0.6);
    }
}

#player-stats {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.player-stat-icon {
    font-size: 16px;
}

.player-stat-icon.flag-green {
    filter: hue-rotate(100deg) saturate(3);
}

.player-stat-value {
    color: #f0c040;
    font-weight: bold;
}

.player-stat-label {
    color: #888;
    font-size: 11px;
}


#player-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: background 0.2s;
    white-space: nowrap;
}

.recruit-btn {
    background: #2d6e2d;
    color: #fff;
    border: 1px solid #4a8a4a;
}

.recruit-btn:hover:not(:disabled) {
    background: #3a8a3a;
}

.recruit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


.gold-btn {
    background: #6e5a2d;
    color: #fff;
    border: 1px solid #8a7a4a;
}

.gold-btn:hover:not(:disabled) {
    background: #8a6a3a;
}

.gold-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.attack-btn {
    background: #8a2d2d;
    color: #fff;
    border: 1px solid #aa4a4a;
}

.attack-btn:hover:not(:disabled) {
    background: #aa3a3a;
}

.attack-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.collect-btn {
    background: #2d8a6e;
    color: #fff;
    border: 1px solid #4aaa8a;
}

.collect-btn:hover {
    background: #3aaa7a;
}


#action-timer-circle {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000);
}

#action-timer-circle .circle-bg {
    fill: none;
    stroke: #ffffff;
    stroke-width: 5;
}

#action-timer-circle .circle-progress {
    fill: none;
    stroke: #f0c040;
    stroke-width: 5;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.3s;
    filter: drop-shadow(0 0 3px rgba(240, 192, 64, 0.6)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.8));
    animation: circlePulse 1s ease-in-out infinite;
}

@keyframes circlePulse {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(240, 192, 64, 0.6)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.8)) hue-rotate(0deg);
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(240, 192, 64, 1)) drop-shadow(0 0 3px rgba(255, 255, 255, 1)) hue-rotate(60deg) brightness(1.2);
    }
}

body.performance-mode #action-progress-fill {
    animation: none;
}

body.performance-mode #action-timer-circle .circle-progress {
    animation: none;
}

#action-timer-circle .circle-icon {
    font-size: 15px;
    dominant-baseline: middle;
    text-anchor: middle;
    fill: #ffffff;
    font-weight: bold;
    font-family: sans-serif;
}

/* GUIA DE ACAO - tooltip com seta */
#action-guide-tooltip {
    position: fixed;
    background: rgba(20, 20, 40, 0.95);
    border: 1px solid #f0c040;
    border-radius: 10px;
    padding: 10px 16px;
    color: #f0c040;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    z-index: 9999;
    pointer-events: none;
    width: 160px;
    animation: guidePopIn 0.3s ease;
    overflow: visible;
}

#action-guide-tooltip .guide-arrow {
    font-size: 22px;
    display: inline-block;
    position: absolute;
    top: var(--arrow-top, auto);
    bottom: var(--arrow-bottom, auto);
    left: var(--arrow-left, auto);
    right: var(--arrow-right, auto);
    transform-origin: center;
    animation-duration: 0.6s;
    animation-timing-function: ease;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

@keyframes guidePopIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes guideBounceDown {
    from { transform: rotate(var(--ar, 0deg)) translateY(0); }
    to { transform: rotate(var(--ar, 0deg)) translateY(5px); }
}

@keyframes guideBounceUp {
    from { transform: rotate(var(--ar, 0deg)) translateY(0); }
    to { transform: rotate(var(--ar, 0deg)) translateY(-5px); }
}

@keyframes guideBounceRight {
    from { transform: rotate(var(--ar, 0deg)) translateX(0); }
    to { transform: rotate(var(--ar, 0deg)) translateX(5px); }
}

@keyframes guideBounceLeft {
    from { transform: rotate(var(--ar, 0deg)) translateX(0); }
    to { transform: rotate(var(--ar, 0deg)) translateX(-5px); }
}

/* ===== SISTEMA DE COLETA / TIMER ===== */
.action-timer {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    margin: 8px 0;
    text-align: center;
}

.action-timer .timer-label {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 4px;
}

.action-timer .timer-value {
    font-size: 16px;
    color: #f0c040;
    font-weight: bold;
}

.collect-btn {
    background: linear-gradient(135deg, #c09030, #f0c040);
    color: #1a1a2e;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
}

.collect-btn:hover {
    opacity: 0.9;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    /* Player panel mobile */
    #player-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 6px 10px;
        flex-wrap: wrap;
        gap: 5px;
        z-index: 999 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        min-height: 44px !important;
    }

    /* Barra de progresso mobile */
    #action-progress-bar {
        top: 45px;
        height: 7px;
    }

    #player-stats {
        gap: 8px;
        flex-wrap: wrap;
    }

    .player-stat {
        font-size: 11px;
        gap: 3px;
    }

    .player-stat-icon {
        font-size: 12px;
    }

    #player-actions {
        gap: 5px;
    }

    .action-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    #action-timer-circle {
        width: 42px;
        height: 42px;
    }

    #action-timer-circle .circle-icon {
        font-size: 14px;
    }

    /* Botao coleta maior em mobile */
    .collect-btn {
        padding: 14px 24px !important;
        font-size: 15px !important;
    }
}
