/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    overflow: hidden;
    background: transparent;
}

.hidden {
    display: none !important;
}

/* Main Inventory Container */
#inventory {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.inventory-container {
    width: 90%;
    max-width: 1400px;
    height: 85vh;
    background: #121212;
    border-radius: 10px;
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Left Side - Inventory */
.inventory-sidebar {
    width: 70%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: #fff;
}

.inventory-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1e88e5;
}

.weight-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weight-bar {
    width: 150px;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

.weight-fill {
    height: 100%;
    background: #1e88e5;
    width: 0%;
    transition: width 0.3s ease;
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    flex: 1;
    /*overflow-y: auto;*/
    padding: 0px;
}

.inventory-slot {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.inventory-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.inventory-slot.empty {
    opacity: 0.5;
}

.inventory-slot.selected {
    background: rgba(30, 136, 229, 0.3);
    border-color: #1e88e5;
    box-shadow: 0 0 10px rgba(30, 136, 229, 0.5);
}

.item-count {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
}

.item-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

/* Item Details */
.item-details {
    display: flex;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    color: #fff;
}

.item-preview {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
}

.item-preview i {
    font-size: 36px;
    color: #1e88e5;
}

.item-info {
    flex: 1;
}

.item-info h3 {
    color: #fff;
    margin-bottom: 5px;
}

.item-info p {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 10px;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 5px 10px;
    background: #1e88e5;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.action-btn:hover {
    background: #0d47a1;
}

/* Right Side - Character & Body */
.character-sidebar {
    width: 30%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
}

.character-section {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex: 1;
}

.clothing-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.clothing-slot {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.clothing-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #1e88e5;
    transform: scale(1.05);
}

.clothing-slot.equipped {
    background: rgba(30, 136, 229, 0.2);
    border-color: #1e88e5;
}

.clothing-slot.equipped::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 4px #4caf50;
}

.clothing-slot i {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.6);
}

.clothing-slot:hover i {
    color: #1e88e5;
}

.clothing-slot.equipped i {
    color: #1e88e5;
}

.slot-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    text-align: center;
}

.equipped-item-name {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 12px;
    color: #4caf50;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(76, 175, 80, 0.8);
}

.character-view {
    flex: 1;
    position: relative;
    background: url('../img/character-bg.svg') no-repeat center center;
    background-size: contain;
    min-width: 200px;
}

.body-part {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(30, 136, 229, 0.2);
    border: 2px solid #1e88e5;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.2s;
}

.body-part:hover {
    background: rgba(30, 136, 229, 0.4);
    transform: translate(-50%, -50%) scale(1.1);
}

.body-part.damaged {
    background: rgba(244, 67, 54, 0.3);
    border-color: #f44336;
}

.body-part.bleeding {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(244, 67, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}

.body-parts-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    color: #fff;
}

.body-part-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.body-part-health {
    height: 4px;
    background: #333;
    border-radius: 2px;
    margin-top: 3px;
    overflow: hidden;
}

.body-part-health-fill {
    height: 100%;
    background: #4caf50;
    width: 100%;
    transition: width 0.3s ease, background 0.3s ease;
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .inventory-container {
        width: 95%;
        height: 90vh;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .inventory-container {
        flex-direction: column;
        height: 95vh;
    }
    
    .inventory-sidebar, .character-sidebar {
        width: 100%;
    }
    
    .inventory-sidebar {
        height: 60%;
    }
    
    .character-sidebar {
        height: 40%;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

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

@keyframes pulse-highlight {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
        border-color: rgba(255, 255, 255, 0.1);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
        border-color: #ff9800;
    }
}

.inventory-container {
    animation: fadeIn 0.3s ease-out;
}
