/* ===== CHARACTER PANEL STYLING ===== */

/* Character List */
.character-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start; /* Links ausrichten */
}

.empty-state {
    color: #888;
    text-align: center;
    padding: 2rem 1rem;
    font-style: italic;
}

/* Character Card - Minimalistisch: nur Bild + Haken-Badge */
.character-card {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 0;
    cursor: pointer;
    transition: opacity 0.2s ease, box-shadow 0.3s ease;
    opacity: 0.75;
    overflow: hidden;
    padding: 0;
    border: 5px solid transparent; /* 5px Border als Platzhalter */
    background: none;
    box-sizing: border-box;
    z-index: 1; /* Card über dem Portrait */
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 5px solid transparent;
    box-sizing: border-box;
    pointer-events: none; /* Klicks durchlassen */
    z-index: 2; /* Border über allem */
}

.character-card.selected::before {
    border-color: #2e8b57; /* Grüner Border wenn selected */
}

.character-card:hover {
    opacity: 1;
}

.character-card.selected {
    opacity: 1;
    box-shadow: 0 0 15px rgba(46, 139, 87, 0.5);
}

.character-card.busy {
    opacity: 0.5;
    cursor: not-allowed;
}

.character-card.busy:hover {
    opacity: 0.5;
}

/* Character Portrait Container - Füllt gesamte Card */
.character-portrait {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    z-index: 0; /* Portrait unter dem Border */
}

.character-portrait img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0;
    padding: 0;
}

.particle-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.character-status-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
    z-index: 3;
}

/* Character Action Button (Sleep/Wake) - Overlay ganz unten */
.character-action-button {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 8px;
    margin: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(6px);
    text-align: center;
    z-index: 10;
    pointer-events: auto;
}

.character-action-button.is-hidden {
    display: none;
}

.character-action-button:hover {
    background: rgba(0, 0, 0, 0.9);
    border-top-color: rgba(255, 255, 255, 0.4);
}

.character-action-button.sleep-button {
    background: rgba(50, 100, 200, 0.65);
}

.character-action-button.sleep-button:hover {
    background: rgba(50, 100, 200, 0.85);
}

.character-action-button.wake-button {
    background: rgba(200, 150, 50, 0.65);
}

.character-action-button.wake-button:hover {
    background: rgba(200, 150, 50, 0.85);
}

/* Wake All Button (appears when Sleep-Mode is active) */
.wake-all-container {
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 200, 100, 0.1);
    border: 2px solid rgba(255, 200, 100, 0.5);
    border-radius: 6px;
}

.wake-all-button {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(255, 200, 100, 0.3), rgba(255, 150, 50, 0.3));
    color: white;
    border: 1px solid rgba(255, 200, 100, 0.6);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    text-align: center;
}

.wake-all-button:hover {
    background: linear-gradient(135deg, rgba(255, 200, 100, 0.5), rgba(255, 150, 50, 0.5));
    border-color: rgba(255, 200, 100, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 200, 100, 0.3);
}

/* Effect Badges Container */
.character-effects-badges {
    position: absolute;
    top: 36px;
    right: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 30px;
    z-index: 2;
    pointer-events: auto;
}

.effect-badge {
    position: relative;
    display: inline-block;
    font-size: 1.1rem;
    cursor: help;
    transition: transform 0.1s ease;
}

.effect-badge:hover {
    transform: scale(1.15);
}

.effect-badge .effect-stack-badge {
    position: absolute;
    bottom: -3px;
    right: -6px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0 3px;
    font-size: 0.65em;
    font-weight: bold;
    line-height: 1;
    min-width: 14px;
    text-align: center;
    pointer-events: none;
}

.effect-badge.buff .effect-stack-badge {
    border-color: rgba(46, 139, 87, 0.5);
    background: rgba(46, 139, 87, 0.9);
}

.effect-badge.debuff .effect-stack-badge {
    border-color: rgba(200, 50, 50, 0.5);
    background: rgba(200, 50, 50, 0.9);
}

.effects-more {
    position: absolute;
    top: 100%;
    right: 0;
    font-size: 0.7rem;
    color: #999;
    margin-top: 2px;
}

/* Character Details - Versteckt, nur im Tooltip sichtbar */
.character-details {
    display: none;
}

.character-name {
    font-weight: bold;
    font-size: 1rem;
    color: #e0e0e0;
}

.character-status-text {
    font-size: 0.85rem;
    color: #aaa;
}

/* Legacy selectors (kept for backwards compatibility) */
.character-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.character-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.character-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.character-status {
    font-size: 0.85rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Character Effects (Buffs/Debuffs) */
.character-effects {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
    justify-content: center;
}

.character-effects .status-effect {
    font-size: 1.2rem;
    cursor: help;
}

/* Effect Stack Badge */
.status-effect {
    position: relative;
    display: inline-block;
}

.effect-stack-badge {
    position: absolute;
    bottom: -2px;
    right: -6px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0 4px;
    font-size: 0.7em;
    font-weight: bold;
    line-height: 1.2;
    min-width: 16px;
    text-align: center;
    pointer-events: none;
}

.status-effect.buff .effect-stack-badge {
    border-color: rgba(46, 139, 87, 0.5);
    background: rgba(46, 139, 87, 0.9);
}

.status-effect.debuff .effect-stack-badge {
    border-color: rgba(200, 50, 50, 0.5);
    background: rgba(200, 50, 50, 0.9);
}

/* Character Skills */
.character-skills {
    font-size: 0.8rem;
    color: #888;
    padding-top: 0.25rem;
    border-top: 1px solid #333;
}

/* Character Tooltip (Werkbank-Style) */
.character-tooltip {
    position: fixed;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 6px;
    padding: 12px 14px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    min-width: 200px;
}

.character-tooltip strong {
    display: block;
    color: #e0e0e0;
    margin-bottom: 6px;
    font-size: 1.1em;
}

.character-tooltip .character-title {
    color: #2e8b57;
    font-size: 0.95em;
    margin-bottom: 8px;
}

.character-tooltip .character-skills {
    color: #aaa;
    font-size: 0.9em;
    margin-bottom: 6px;
    padding-top: 0;
    border-top: none;
}

.character-tooltip .character-traits {
    color: #999;
    font-size: 0.85em;
    font-style: italic;
}

.character-tooltip .character-status-info {
    color: #aaa;
    font-size: 0.85em;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #444;
}

/* Effect Badge Tooltip */
.effect-badge-tooltip {
    position: fixed;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px 10px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    font-size: 0.85em;
    color: #ddd;
    white-space: pre-wrap;
    line-height: 1.3;
    max-width: 220px;
}

/* Tooltip for status effects - inherits from status-effects.css */
.character-card .status-effect:hover {
    transform: scale(1.1);
}

