/* Side Panel Styles */
#sidePanel {
    width: 350px;
    background: rgba(44, 62, 80, 0.95);
    border-left: 2px solid #e74c3c;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(52, 73, 94, 0.9);
    border-bottom: 1px solid #2c3e50;
}

.panel-header h3 {
    color: #e74c3c;
    font-size: 1.1rem;
}

.panel-header button {
    background: none;
    border: none;
    color: #bdc3c7;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background 0.3s;
}

.panel-header button:hover {
    background: rgba(231, 76, 60, 0.2);
}

/* Chat Section */
#chatSection {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.chat-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: rgba(52, 73, 94, 0.5);
    border-bottom: 1px solid #2c3e50;
}

.chat-message {
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 5px;
    background: rgba(44, 62, 80, 0.7);
    border-left: 3px solid #e74c3c;
}

.chat-message.system {
    border-left-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

.chat-message.own {
    border-left-color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.chat-player {
    font-weight: bold;
    color: #e74c3c;
    margin-right: 8px;
}

.chat-text {
    color: #ecf0f1;
    word-wrap: break-word;
}

.chat-time {
    font-size: 0.8rem;
    color: #95a5a6;
    float: right;
}

.chat-input {
    display: flex;
    padding: 10px;
    background: rgba(44, 62, 80, 0.8);
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 8px;
    border: 1px solid #34495e;
    border-radius: 5px;
    background: #2c3e50;
    color: #ecf0f1;
    font-size: 0.9rem;
}

.chat-input input:focus {
    outline: none;
    border-color: #e74c3c;
}

.chat-input button {
    padding: 8px 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.chat-input button:hover {
    background: #c0392b;
}

/* Skills Section */
#skillsSection {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.skills-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: rgba(52, 73, 94, 0.5);
}

.skill-item {
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(44, 62, 80, 0.7);
    border-radius: 5px;
    border: 1px solid #34495e;
    transition: all 0.3s;
}

.skill-item:hover {
    border-color: #e74c3c;
    background: rgba(44, 62, 80, 0.9);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.skill-name {
    font-weight: bold;
    color: #e74c3c;
}

.skill-level {
    font-size: 0.9rem;
    color: #bdc3c7;
}

.skill-progress {
    width: 100%;
    height: 8px;
    background: #34495e;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.skill-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #f39c12);
    transition: width 0.3s ease;
}

.skill-exp {
    font-size: 0.8rem;
    color: #95a5a6;
    text-align: right;
}

/* Inventory Section */
#inventorySection {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.inventory-content {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: rgba(52, 73, 94, 0.5);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 5px;
}

.inventory-slot {
    width: 60px;
    height: 60px;
    background: rgba(44, 62, 80, 0.7);
    border: 2px solid #34495e;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.inventory-slot:hover {
    border-color: #e74c3c;
    background: rgba(44, 62, 80, 0.9);
}

.inventory-slot.occupied {
    border-color: #27ae60;
}

.item-icon {
    width: 40px;
    height: 40px;
    background: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.item-quantity {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(44, 62, 80, 0.95);
    border: 2px solid #e74c3c;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(52, 73, 94, 0.9);
    border-bottom: 1px solid #2c3e50;
}

.modal-header h3 {
    color: #e74c3c;
    font-size: 1.3rem;
}

.close-modal {
    background: none;
    border: none;
    color: #bdc3c7;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background 0.3s;
}

.close-modal:hover {
    background: rgba(231, 76, 60, 0.2);
}

.modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Crafting Modal */
.recipe-item {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(52, 73, 94, 0.7);
    border-radius: 5px;
    border: 1px solid #34495e;
    transition: all 0.3s;
}

.recipe-item:hover {
    border-color: #e74c3c;
    background: rgba(52, 73, 94, 0.9);
}

.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.recipe-name {
    font-weight: bold;
    color: #e74c3c;
    font-size: 1.1rem;
}

.recipe-difficulty {
    font-size: 0.9rem;
    color: #f39c12;
}

.recipe-materials {
    margin-bottom: 10px;
}

.recipe-materials h4 {
    color: #bdc3c7;
    margin-bottom: 5px;
}

.material-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.material-item {
    background: rgba(44, 62, 80, 0.7);
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.9rem;
    color: #ecf0f1;
    border: 1px solid #2c3e50;
}

.material-item.missing {
    color: #e74c3c;
    border-color: #e74c3c;
}

.craft-button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.craft-button:hover {
    background: #219a52;
}

.craft-button:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
}

/* Outfit Modal */
.outfit-customizer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.outfit-preview {
    background: rgba(52, 73, 94, 0.7);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.outfit-options {
    background: rgba(52, 73, 94, 0.7);
    border-radius: 10px;
    padding: 20px;
}

.outfit-category {
    margin-bottom: 15px;
}

.outfit-category h4 {
    color: #e74c3c;
    margin-bottom: 8px;
}

.outfit-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.outfit-item {
    width: 40px;
    height: 40px;
    background: rgba(44, 62, 80, 0.7);
    border: 2px solid #34495e;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.outfit-item:hover {
    border-color: #e74c3c;
}

.outfit-item.selected {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.2);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #34495e;
}

::-webkit-scrollbar-thumb {
    background: #e74c3c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Responsive Design for Side Panel */
@media (max-width: 1024px) {
    #sidePanel {
        width: 300px;
    }
}

@media (max-width: 768px) {
    #gameWorld {
        flex-direction: column;
    }
    
    #sidePanel {
        width: 100%;
        height: 300px;
        border-left: none;
        border-top: 2px solid #e74c3c;
    }
    
    .outfit-customizer {
        grid-template-columns: 1fr;
    }
}
