/* ===================================
   CHARACTER SHEET - PAPERDOLL STYLE
   Gospel-driven stat display
   =================================== */

/* === MODAL OVERLAY - DISABLED === */
.character-sheet-overlay {
    display: none;
}

/* === MAIN PANEL === */
#character-sheet-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    background: linear-gradient(135deg, rgba(42, 37, 32, 0.95), rgba(74, 63, 53, 0.95));
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    padding: 0;
    border-radius: 10px;
    border: 2px solid #d4af37;
    width: 480px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 100px);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform-origin: bottom left;
}

/* Collapsed state */
#character-sheet-panel.collapsed {
    transform: scale(0.9);
    opacity: 0.9;
    max-height: 50px;
    max-width: 50px;
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#character-sheet-panel.collapsed:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

#character-sheet-panel.collapsed .cs-header,
#character-sheet-panel.collapsed .cs-content,
#character-sheet-panel.collapsed .cs-footer {
    display: none;
}

#character-sheet-panel.collapsed .cs-collapsed-icon {
    display: flex;
}

/* === COLLAPSED ICON (shown when panel is collapsed) === */
.cs-collapsed-icon {
    display: none;
    font-size: 24px;
    color: #d4af37;
}

/* === HEADER === */
.cs-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(139, 115, 85, 0.1));
    border-bottom: 2px solid #d4af37;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cs-header:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(139, 115, 85, 0.2));
}

.cs-header-icon {
    font-size: 18px;
}

.cs-title {
    font-size: 16px;
    font-weight: bold;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Remove old close button styles - keeping for backwards compat */
.cs-close-btn {
    display: none;
    background: rgba(139, 115, 85, 0.3);
    border: 1px solid #8b7355;
    color: #d4af37;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cs-close-btn:hover {
    background: rgba(139, 115, 85, 0.5);
    border-color: #d4af37;
    transform: scale(1.1);
}

/* === CONTENT CONTAINER === */
.cs-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Custom scrollbar */
.cs-content::-webkit-scrollbar {
    width: 8px;
}

.cs-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.cs-content::-webkit-scrollbar-thumb {
    background: #8b7355;
    border-radius: 4px;
}

.cs-content::-webkit-scrollbar-thumb:hover {
    background: #a08060;
}

/* === PAPERDOLL SECTION === */
.cs-paperdoll {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: linear-gradient(135deg, rgba(30, 25, 20, 0.8), rgba(50, 40, 30, 0.8));
    border: 1px solid rgba(139, 115, 85, 0.5);
    border-radius: 8px;
    position: relative;
}

.cs-model-container {
    width: 140px;
    height: 140px;
    border: 2px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(20, 15, 10, 0.9), rgba(40, 30, 20, 0.9));
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

#cs-model-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px;
}

.cs-model-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #d4af37;
    font-size: 14px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.cs-player-name {
    font-size: 16px;
    font-weight: bold;
    color: #d4af37;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Future equipment slot placeholders - not visible yet */
.cs-equipment-slots {
    display: none; /* Hidden until equipment system is ready */
}

/* === STATS MATRIX SECTION === */
.cs-stats-section {
    background: linear-gradient(135deg, rgba(30, 25, 20, 0.8), rgba(50, 40, 30, 0.8));
    border: 1px solid rgba(139, 115, 85, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.cs-section-header {
    display: none; /* Hidden - cleaner look */
}

.cs-section-title {
    font-size: 12px;
    font-weight: bold;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === STATS TABLE === */
.cs-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.cs-stats-table th,
.cs-stats-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(139, 115, 85, 0.15);
}

.cs-stats-table th {
    background: rgba(0, 0, 0, 0.3);
    color: #999;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cs-stats-table th:first-child {
    text-align: left;
    padding-left: 10px;
}

.cs-stats-table td:first-child {
    text-align: left;
    padding-left: 10px;
    font-weight: 600;
    color: #e6d5b8;
}

.cs-stats-table tr:hover {
    background: rgba(212, 175, 55, 0.05);
}

.cs-stats-table tr:last-child td {
    border-bottom: none;
}

/* Stat name styling */
.cs-stat-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

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

/* Value styling */
.cs-value-base {
    color: #b8b8b8;
    font-weight: 500;
    font-size: 13px;
}

.cs-value-bonus {
    font-weight: 600;
    font-size: 12px;
}

.cs-value-bonus.positive {
    color: #7dc383;
}

.cs-value-bonus.neutral {
    color: #666;
}

.cs-value-final {
    color: #d4af37;
    font-weight: bold;
    font-size: 14px;
}

/* Ore-specific row colors */
.cs-row-gold .cs-stat-name { color: #ffd700; }
.cs-row-silver .cs-stat-name { color: #c0c0c0; }
.cs-row-copper .cs-stat-name { color: #cd7f32; }

.cs-row-gold .cs-value-final { color: #ffd700; }
.cs-row-silver .cs-value-final { color: #c0c0c0; }
.cs-row-copper .cs-value-final { color: #cd7f32; }

/* === GUILD COMPOSITION SECTION === */
.cs-guild-section {
    background: linear-gradient(135deg, rgba(30, 25, 20, 0.8), rgba(50, 40, 30, 0.8));
    border: 1px solid rgba(139, 115, 85, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.cs-guild-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 10px;
}

.cs-guild-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 115, 85, 0.3);
    border-radius: 6px;
    padding: 8px 6px;
    text-align: center;
    transition: all 0.2s ease;
}

.cs-guild-card:hover {
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(0, 0, 0, 0.4);
}

.cs-guild-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.cs-guild-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.cs-guild-value {
    font-size: 18px;
    font-weight: bold;
    color: #d4af37;
}

.cs-guild-sublabel {
    font-size: 9px;
    color: #666;
    margin-top: 1px;
}

/* Guild card variants */
.cs-guild-card.forgemaster {
    border-color: rgba(255, 100, 0, 0.4);
}
.cs-guild-card.forgemaster .cs-guild-value { color: #ff6600; }

.cs-guild-card.jewelers {
    border-color: rgba(212, 175, 55, 0.4);
}

.cs-guild-card.crew {
    border-color: rgba(100, 180, 255, 0.4);
}
.cs-guild-card.crew .cs-guild-value { color: #64b4ff; }

.cs-guild-card.blacksmiths {
    border-color: rgba(205, 127, 50, 0.4);
}
.cs-guild-card.blacksmiths .cs-guild-value { color: #cd7f32; }

.cs-guild-card.miners {
    border-color: rgba(139, 115, 85, 0.4);
}
.cs-guild-card.miners .cs-guild-value { color: #8b7355; }

/* === TOTALS SECTION === */
.cs-totals-section {
    background: linear-gradient(135deg, rgba(30, 25, 20, 0.8), rgba(50, 40, 30, 0.8));
    border: 1px solid rgba(139, 115, 85, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

.cs-totals-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 10px;
}

.cs-total-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 115, 85, 0.2);
    border-radius: 6px;
    padding: 6px;
    text-align: center;
}

.cs-total-label {
    font-size: 9px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.cs-total-value {
    font-size: 14px;
    font-weight: bold;
    color: #e6d5b8;
}

.cs-total-card.gold .cs-total-value { color: #ffd700; }
.cs-total-card.silver .cs-total-value { color: #c0c0c0; }
.cs-total-card.copper .cs-total-value { color: #cd7f32; }

/* === GOSPEL VERSION FOOTER === */
.cs-footer {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(139, 115, 85, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cs-gospel-version {
    font-size: 10px;
    color: #666;
}

.cs-gospel-version.synced {
    color: #7dc383;
}

.cs-gospel-version.stale {
    color: #ffaa00;
}

/* === RESPONSIVE === */
@media (max-width: 520px) {
    #character-sheet-panel {
        width: 95vw;
    }

    .cs-stats-table th,
    .cs-stats-table td {
        padding: 5px 4px;
        font-size: 10px;
    }

    .cs-stats-table th {
        font-size: 8px;
    }

    .cs-guild-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cs-totals-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cs-model-container {
        width: 120px;
        height: 120px;
    }
}
