/* Shared Backdrop (Refined) */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

/* Combat Modal Container - Matches Inventory Redesign */
.combat-inventory-modal {
    width: 90%;
    max-width: 600px;
    /* Slightly wider for better card display */
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1e2a38 0%, #121820 100%);
    border: 1px solid #3a4b5c;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    color: #e0e6ed;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 2001;
    clip-path: var(--game-clip-path);
}

/* Header */
.combat-inventory-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #3a4b5c;
}

.combat-inventory-modal .modal-header h3 {
    margin: 0;
    color: #ff6b6b;
    /* Reddish for combat focus */
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.combat-inventory-modal .close-btn {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.combat-inventory-modal .close-btn:hover {
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Flex container for scrollable list */
    flex: 1;
}

/* Search Input */
.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #3a4b5c;
    clip-path: var(--game-clip-path-sm);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #ff6b6b;
}

/* Items List */
.items-list {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
}

.no-items {
    text-align: center;
    color: #718096;
    padding: 2rem;
    font-style: italic;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
}

/* Item Card - Matching Inventory Compact Style */
.combat-item-card {
    display: flex;
    flex-direction: row;
    background-color: rgba(26, 32, 44, 0.8);
    border: 1px solid #2d3748;
    clip-path: var(--game-clip-path);
    padding: 0.75rem;
    gap: 1rem;
    align-items: stretch;
    transition: all 0.2s ease;
    cursor: pointer;
}

.combat-item-card:hover {
    border-color: #ff6b6b;
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

/* Image Section */
.item-image-section {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    clip-path: var(--game-clip-path);
    border: 1px solid #4a5568;
}

.item-img-thumb {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.item-icon-large {
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-icon-large.hidden {
    display: none;
}

.item-quantity-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #2d3748;
    border: 1px solid #4a5568;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    clip-path: var(--game-clip-path-sm);
    font-weight: bold;
}

/* Info Section */
.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    min-width: 0;
}

.item-name {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-description {
    font-size: 0.85rem;
    color: #a0aec0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

/* Stat Badges */
.item-effects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stat-badge {
    padding: 0.25rem 0.5rem;
    clip-path: var(--game-clip-path-sm);
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* Badge Colors */
.stat-badge.healing,
.stat-badge.health {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.4);
}

.stat-badge.stamina,
.stat-badge.crit {
    background-color: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border-color: rgba(234, 179, 8, 0.4);
}

.stat-badge.damage,
.stat-badge.penetration {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}

.stat-badge.armor {
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.4);
}

.stat-badge.accuracy {
    background-color: rgba(20, 184, 166, 0.2);
    color: #5eead4;
    border-color: rgba(20, 184, 166, 0.4);
}

.stat-badge.dodge {
    background-color: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.4);
}

.stat-badge.lifesteal {
    background-color: rgba(236, 72, 153, 0.2);
    color: #f9a8d4;
    border-color: rgba(236, 72, 153, 0.4);
}

.stat-badge.strength {
    background-color: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    border-color: rgba(249, 115, 22, 0.4);
}

.stat-badge.agility {
    background-color: rgba(6, 182, 212, 0.2);
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.4);
}

.stat-badge.endurance {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.4);
}

.stat-badge.capacity {
    background-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.4);
}

/* Use Button (Embedded in card) */
.btn-use {
    background: rgba(72, 187, 120, 0.2);
    color: #48bb78;
    border: 1px solid rgba(72, 187, 120, 0.4);
    padding: 0.5rem 1rem;
    clip-path: var(--game-clip-path-sm);
    cursor: pointer;
    font-weight: bold;
    margin-left: 0.5rem;
    height: fit-content;
    align-self: center;
    transition: all 0.2s;
}

.btn-use:hover {
    background: rgba(72, 187, 120, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Tier Colors for Names/Icons */
.text-tier-0 {
    color: #a0aec0;
}

.text-tier-1 {
    color: #ffffff;
}

.text-tier-2 {
    color: #68d391;
}

.text-tier-3 {
    color: #63b3ed;
}

.text-tier-4 {
    color: #9f7aea;
}

.text-tier-5 {
    color: #ed8936;
}

.item-icon-large.tier-0 {
    text-shadow: 0 0 10px rgba(160, 174, 192, 0.3);
}

.item-icon-large.tier-1 {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.item-icon-large.tier-2 {
    text-shadow: 0 0 10px rgba(104, 211, 145, 0.3);
}

.item-icon-large.tier-3 {
    text-shadow: 0 0 10px rgba(99, 179, 237, 0.3);
}

.item-icon-large.tier-4 {
    text-shadow: 0 0 10px rgba(159, 122, 234, 0.3);
}

.item-icon-large.tier-5 {
    text-shadow: 0 0 10px rgba(237, 137, 54, 0.3);
}