/* Character Sheet Panel Styles */
#character-sheet-panel {
    position: fixed;
    top: 50%;
    right: 25%;
    transform: translate(50%, -50%);
    width: 700px;
    height: 600px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 20px;
    z-index: 1000;
    color: white;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

#character-sheet-panel h2 {
    margin: 0 0 20px 0;
    text-align: center;
    color: #fff;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#character-sheet-panel h3 {
    margin: 0 0 15px 0;
    color: #ffd700;
    font-size: 18px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#character-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    height: calc(100% - 50px);
}

/* Character Info Section */
#character-info {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: -10px;
    padding-bottom: 15px;
    border-bottom: 2px solid #444;
}

.character-name-display {
    font-size: 22px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin-bottom: 5px;
}

.character-class-display {
    font-size: 16px;
    color: #ccc;
    text-transform: capitalize;
    font-style: italic;
}

/* Character Stats Section */
#character-stats {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    max-height: 420px;
    overflow-y: auto;
}

.stat-category {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #444;
}

.stat-category:last-child {
    border-bottom: none;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
    padding: 2px 6px;
    background: rgba(50, 50, 50, 0.5);
    border-radius: 4px;
    font-size: 11px;
}

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

.stat-value {
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    transition: color 0.3s ease;
}

.stat-value.stat-updated {
    color: #4CAF50;
    text-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

/* Equipment Slots Section */
#equipment-slots {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
}

.equipment-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.equipment-slot {
    width: 65px;
    height: 65px;
    background: rgba(50, 50, 50, 0.8);
    border: 2px solid #666;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.equipment-slot:hover {
    background: rgba(70, 70, 70, 0.9);
    border-color: #888;
    transform: scale(1.05);
}

.equipment-slot.occupied {
    background: rgba(100, 150, 100, 0.8);
    border-color: #4CAF50;
}

.equipment-slot.drag-over {
    background-color: rgba(255, 255, 0, 0.3);
    border-color: #ffff00;
    transform: scale(1.1);
}

.slot-label {
    position: absolute;
    bottom: 2px;
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
}

.equipment-slot .item-icon {
    font-size: 26px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

/* Equipment spacer for layout */
.equipment-spacer {
    width: 60px;
    height: 60px;
    display: inline-block;
}

/* Specific slot styling */
#slot-head {
    border-color: #4ecdc4;
}

#slot-shoulders {
    border-color: #7d5d8a;
}

#slot-amulet {
    border-color: #ffd700;
}

#slot-gloves {
    border-color: #8b4513;
}

#slot-chest {
    border-color: #45b7d1;
}

#slot-bracers {
    border-color: #cd853f;
}

#slot-belt {
    border-color: #8b7355;
}

#slot-pants {
    border-color: #696969;
}

#slot-boots {
    border-color: #96ceb4;
}

#slot-ring-left, #slot-ring-right {
    border-color: #ffd700;
}

#slot-mainhand {
    border-color: #ff6b6b;
}

#slot-offhand {
    border-color: #dda0dd;
}

/* Close button for character sheet */
#character-sheet-panel .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

#character-sheet-panel .close-btn:hover {
    color: #ff6b6b;
}

/* When both panels are open, stack them vertically on mobile */
@media (max-width: 1024px) {
    body.both-panels-open #character-sheet-panel {
        top: 25%;
        right: 25%;
        transform: translate(50%, -50%);
        width: 45vw;
        height: 45vh;
    }
    
    body.both-panels-open #inventory-panel {
        top: 75%;
        left: 25%;
        transform: translate(-50%, -50%);
        width: 45vw;
        height: 45vh;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #character-sheet-panel {
        width: 95vw;
        height: 90vh;
        padding: 15px;
        right: 2.5%;
        transform: translateY(-50%);
    }
    
    /* On mobile, when both panels are open, stack them */
    body.both-panels-open #character-sheet-panel {
        top: 25%;
        right: 2.5%;
        transform: translateY(-50%);
        width: 95vw;
        height: 45vh;
    }
    
    body.both-panels-open #inventory-panel {
        top: 75%;
        left: 2.5%;
        transform: translateY(-50%);
        width: 95vw;
        height: 45vh;
    }
    
    #character-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .equipment-slot {
        width: 60px;
        height: 60px;
    }
    
    .equipment-slot .item-icon {
        font-size: 24px;
    }
    
    .stat-line {
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .equipment-slot {
        width: 50px;
        height: 50px;
    }
    
    .equipment-row {
        gap: 5px;
    }
    
    #character-stats, #equipment-slots {
        padding: 10px;
    }
}