/* Grimdark Fantasy Paperdoll Styles */

:root {
    --paperdoll-bg: #0a0a0a;
    --paperdoll-border: #2a0a0a;
    --paperdoll-slot-empty: #1a0505;
    --paperdoll-slot-filled: #3a1010;
    --paperdoll-slot-hover: #4a1515;
    --paperdoll-text: #8a8a8a;
    --paperdoll-text-highlight: #aa3333;
    --paperdoll-shadow: rgba(139, 0, 0, 0.3);
    --paperdoll-glow: rgba(139, 0, 0, 0.5);
}

/* Main Paperdoll Container */
.paperdoll-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    background: linear-gradient(135deg, var(--paperdoll-bg) 0%, #1a0a0a 100%);
    border: 2px solid var(--paperdoll-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--paperdoll-shadow);
    overflow: hidden;
}

.paperdoll-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px
        );
    pointer-events: none;
    opacity: 0.3;
}

/* Character Silhouette */
.character-silhouette {
    position: relative;
    width: 200px;
    height: 400px;
    margin: 0 auto;
    background: radial-gradient(ellipse at center, rgba(20, 5, 5, 0.8) 0%, transparent 70%);
    filter: drop-shadow(0 0 20px rgba(139, 0, 0, 0.4));
}

.character-silhouette::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(40, 10, 10, 0.9) 0%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(139, 0, 0, 0.6);
}

.character-silhouette::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 250px;
    background: linear-gradient(180deg, 
        rgba(40, 10, 10, 0.7) 0%,
        rgba(30, 8, 8, 0.6) 30%,
        rgba(20, 5, 5, 0.5) 60%,
        transparent 100%
    );
    clip-path: polygon(30% 0%, 70% 0%, 85% 30%, 90% 60%, 80% 100%, 20% 100%, 10% 60%, 15% 30%);
    filter: blur(2px);
}

/* Equipment Slots Layout */
.equipment-slots {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.equipment-slot {
    position: absolute;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--paperdoll-slot-empty) 0%, #0a0000 100%);
    border: 2px solid var(--paperdoll-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.equipment-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(139, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.equipment-slot:hover {
    background: linear-gradient(135deg, var(--paperdoll-slot-hover) 0%, #1a0505 100%);
    border-color: var(--paperdoll-text-highlight);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9), 0 0 15px var(--paperdoll-glow);
    transform: scale(1.05);
}

.equipment-slot:hover::before {
    opacity: 1;
}

.equipment-slot.filled {
    background: linear-gradient(135deg, var(--paperdoll-slot-filled) 0%, #2a0a0a 100%);
    border-color: #5a2020;
    box-shadow: inset 0 0 10px rgba(139, 0, 0, 0.3), 0 0 10px var(--paperdoll-glow);
}

.equipment-slot.drag-over {
    background: linear-gradient(135deg, #4a1515 0%, #3a1010 100%);
    border-color: var(--paperdoll-text-highlight);
    box-shadow: inset 0 0 20px rgba(139, 0, 0, 0.5), 0 0 20px var(--paperdoll-glow);
    transform: scale(1.1);
}

/* Slot Positions */
.slot-head { top: 20px; left: 50%; transform: translateX(-50%); }
.slot-neck { top: 100px; left: 50%; transform: translateX(-50%); }
.slot-body { top: 180px; left: 50%; transform: translateX(-50%); }
.slot-belt { top: 260px; left: 50%; transform: translateX(-50%); }
.slot-legs { top: 340px; left: 50%; transform: translateX(-50%); }
.slot-feet { top: 420px; left: 50%; transform: translateX(-50%); }

.slot-weapon { top: 180px; left: 20px; }
.slot-shield { top: 180px; right: 20px; }
.slot-hands { top: 260px; left: 20px; }
.slot-back { top: 260px; right: 20px; }

/* Slot Labels */
.slot-label {
    font-size: 10px;
    color: var(--paperdoll-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    font-weight: bold;
    z-index: 2;
}

.equipment-slot.filled .slot-label {
    color: var(--paperdoll-text-highlight);
}

/* Item Image in Slot */
.slot-item-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(139, 0, 0, 0.5));
    z-index: 1;
}

.slot-item-placeholder {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(60, 20, 20, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
}

/* Item Tooltip */
.item-tooltip {
    position: absolute;
    background: linear-gradient(135deg, #1a0505 0%, #0a0000 100%);
    border: 2px solid var(--paperdoll-text-highlight);
    border-radius: 6px;
    padding: 12px;
    min-width: 200px;
    max-width: 300px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.8);
    display: none;
}

.item-tooltip.show {
    display: block;
}

.tooltip-name {
    color: var(--paperdoll-text-highlight);
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    text-shadow: 0 0 5px rgba(139, 0, 0, 0.8);
}

.tooltip-description {
    color: var(--paperdoll-text);
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.tooltip-stats {
    color: #6a9955;
    font-size: 11px;
    border-top: 1px solid var(--paperdoll-border);
    padding-top: 8px;
    margin-top: 8px;
}

.tooltip-stat {
    margin: 2px 0;
}

/* Jewelry Tab Styles */
.jewelry-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, var(--paperdoll-bg) 0%, #1a0a0a 100%);
    border: 2px solid var(--paperdoll-border);
    border-radius: 8px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.jewelry-slot {
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, var(--paperdoll-slot-empty) 0%, #0a0000 100%);
    border: 2px solid var(--paperdoll-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.6);
}

.jewelry-slot:hover {
    background: linear-gradient(135deg, var(--paperdoll-slot-hover) 0%, #1a0505 100%);
    border-color: var(--paperdoll-text-highlight);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9), 0 0 15px var(--paperdoll-glow);
    transform: scale(1.02);
}

.jewelry-slot.filled {
    background: linear-gradient(135deg, var(--paperdoll-slot-filled) 0%, #2a0a0a 100%);
    border-color: #5a2020;
}

.jewelry-label {
    font-size: 12px;
    color: var(--paperdoll-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

/* Equipment Stats Panel */
.equipment-stats {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #0a0000 0%, #1a0505 100%);
    border: 2px solid var(--paperdoll-border);
    border-radius: 6px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.equipment-stats h6 {
    color: var(--paperdoll-text-highlight);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-size: 12px;
    text-shadow: 0 0 5px rgba(139, 0, 0, 0.8);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(139, 0, 0, 0.2);
    color: var(--paperdoll-text);
    font-size: 12px;
}

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

.stat-value {
    color: #6a9955;
    font-weight: bold;
}

.stat-value.positive {
    color: #4ec9b0;
}

.stat-value.negative {
    color: #f48771;
}

/* Drag and Drop States */
.inventory-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.inventory-item {
    cursor: grab;
}

/* Unequip Button */
.unequip-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(139, 0, 0, 0.8);
    border: 1px solid var(--paperdoll-text-highlight);
    border-radius: 3px;
    color: white;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.equipment-slot:hover .unequip-btn {
    opacity: 1;
}

.unequip-btn:hover {
    background: rgba(139, 0, 0, 1);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .paperdoll-container {
        min-height: 400px;
        padding: 10px;
    }
    
    .character-silhouette {
        width: 150px;
        height: 300px;
    }
    
    .equipment-slot {
        width: 60px;
        height: 60px;
    }
    
    .slot-item-image {
        width: 40px;
        height: 40px;
    }
    
    .jewelry-container {
        grid-template-columns: 1fr;
    }
}

/* Animation for equipped items */
@keyframes equipGlow {
    0%, 100% {
        box-shadow: inset 0 0 10px rgba(139, 0, 0, 0.3), 0 0 10px var(--paperdoll-glow);
    }
    50% {
        box-shadow: inset 0 0 15px rgba(139, 0, 0, 0.5), 0 0 20px var(--paperdoll-glow);
    }
}

.equipment-slot.just-equipped {
    animation: equipGlow 1s ease-in-out;
}

/* Hand silhouettes for jewelry tab */
.hand-silhouette {
    width: 100%;
    height: 120px;
    background: radial-gradient(circle at 30% 40%, rgba(40,10,10,0.6), transparent 60%),
                radial-gradient(circle at 70% 60%, rgba(30,8,8,0.5), transparent 65%);
    border: 2px solid var(--paperdoll-border);
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.8);
}

.hand-silhouette.left-hand {
    background:
        radial-gradient(circle at 25% 50%, rgba(60, 15, 15, 0.4), transparent 55%),
        radial-gradient(circle at 45% 45%, rgba(45, 12, 12, 0.5), transparent 50%),
        linear-gradient(135deg, rgba(20,5,5,0.5), rgba(10,0,0,0.2));
}

.hand-silhouette.right-hand {
    background:
        radial-gradient(circle at 75% 50%, rgba(60, 15, 15, 0.4), transparent 55%),
        radial-gradient(circle at 55% 55%, rgba(45, 12, 12, 0.5), transparent 50%),
        linear-gradient(225deg, rgba(20,5,5,0.5), rgba(10,0,0,0.2));
}
