/* Stats Overlay Panel - Slides in from right on combat block hover/click */

.stats-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 40%, #1a1a2e 100%);
    border-left: 3px solid #4ecdc4;
    z-index: 500;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
}

.stats-overlay.visible {
    transform: translateX(0);
}

.stats-overlay.pinned {
    border-left-color: #ffd700;
    box-shadow: -5px 0 30px rgba(255, 215, 0, 0.15), -2px 0 8px rgba(255, 215, 0, 0.3);
}

/* Header */
.stats-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(78, 205, 196, 0.2);
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #1a1a2e 0%, #1a1a2eee 100%);
    z-index: 1;
}

.stats-overlay-header .overlay-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #ffd700;
}

.stats-overlay-header .pin-indicator {
    font-size: 0.75em;
    color: #ffd700;
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 8px;
}

.stats-overlay.pinned .pin-indicator {
    opacity: 1;
}

.stats-overlay-close {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #aaa;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    transition: all 0.2s;
}

.stats-overlay-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Content area */
.stats-overlay-content {
    padding: 12px 16px 24px;
}

/* Section styling within overlay */
.stats-overlay .proficiencies {
    margin-bottom: 16px;
}

.stats-overlay .prof-title {
    font-size: 0.9em;
    color: #ffd700;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

.stats-overlay .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.stats-overlay .stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

.stats-overlay .stat-card.cursor-pointer:hover {
    border-color: rgba(78, 205, 196, 0.4);
    background: rgba(78, 205, 196, 0.05);
}

.stats-overlay .stat-name {
    font-size: 0.7em;
    color: #8a8a9a;
    margin-bottom: 2px;
}

.stats-overlay .stat-value {
    font-size: 0.85em;
    font-weight: 600;
    color: #e0e0e0;
    word-break: break-all;
}

/* Rebirth section */
.stats-overlay .rebirth-section {
    border-top: 2px solid rgba(155, 89, 182, 0.3);
    padding-top: 12px;
    margin-top: 8px;
}

.stats-overlay .rebirth-section .prof-title {
    color: #9b59b6;
    border-bottom-color: rgba(155, 89, 182, 0.15);
}

/* Rebirth button in overlay */
.stats-overlay .overlay-rebirth-btn {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3), rgba(192, 57, 43, 0.3));
    border: 1px solid #e74c3c;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.stats-overlay .overlay-rebirth-btn:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.5), rgba(192, 57, 43, 0.5));
}

/* Elemental color classes */
.stats-overlay .text-elem-fire { color: #e74c3c; }
.stats-overlay .text-elem-water { color: #3498db; }
.stats-overlay .text-elem-wood { color: #2ecc71; }
.stats-overlay .text-elem-metal { color: #95a5a6; }
.stats-overlay .text-elem-earth { color: #f39c12; }
