/* --- START OF FILE inventory-ui.css --- */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* --- INVENTARIO PRINCIPAL --- */
#inventory-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    transition: opacity 0.2s;
    padding: 10px;
    box-sizing: border-box;
}

#inventory-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

#inventory-panel {
    width: 100%;
    max-width: 450px;
    height: 85vh;
    max-height: 800px;
    background: #202028;
    border: 4px solid #ffffff;
    outline: 4px solid #000000;
    box-shadow: 12px 12px 0px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    padding: 24px;
    color: white;
    font-family: 'Press Start 2P', cursive, monospace;
    animation: panelPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

#inventory-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(#333 15%, transparent 16%), radial-gradient(#333 15%, transparent 16%);
    background-size: 16px 16px;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

@keyframes panelPop {
    0% { transform: scale(0.8) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #000;
    padding-bottom: 20px;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.inventory-header h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    text-shadow: 2px 2px 0 #000;
    color: #fbbf24;
}

#inventory-close {
    background: #ef4444;
    border: 2px solid #fff;
    outline: 2px solid #000;
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset -4px -4px 0 rgba(0,0,0,0.3);
    transition: transform 0.1s;
}

#inventory-close:active {
    transform: translateY(2px);
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.3);
}

#inventory-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    position: relative;
    z-index: 2;
    -webkit-overflow-scrolling: touch; 
}

#inventory-list::-webkit-scrollbar { width: 12px; }
#inventory-list::-webkit-scrollbar-track { background: #000; border-left: 2px solid #fff; }
#inventory-list::-webkit-scrollbar-thumb { background: #fff; border: 2px solid #000; box-shadow: inset -2px -2px 0 #aaa; }

/* --- ITEM LIST CARD --- */

.inventory-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #000;
    margin-bottom: 12px;
    padding: 12px;
    border: 2px solid #444;
    border-left-width: 6px;
    box-shadow: inset 4px 4px 0 rgba(0,0,0,0.5);
    position: relative;
    transition: transform 0.1s, background-color 0.1s;
    image-rendering: pixelated;
    cursor: pointer; /* Indica que es clicable */
}

.inventory-item:active {
    background: #111;
    transform: scale(0.98);
}

.inventory-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 0 rgba(255,255,255,0.2));
    animation: itemFloat 3s infinite steps(4);
}

@keyframes itemFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.item-name {
    font-size: 12px;
    line-height: 1.4;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-rarity {
    font-size: 8px;
    padding: 4px 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.item-chance {
    font-size: 7px;
    color: #888;
    font-family: 'Courier New', monospace;
    margin-top: 2px;
}

.item-count {
    font-size: 10px;
    color: #fff;
    background: #333;
    padding: 4px 8px;
    border: 1px solid #666;
    box-shadow: 2px 2px 0 #000;
}

/* --- RARITY STYLES (Used in list) --- */
.item-rarity-common { border-left-color: #94a3b8; }
.item-rarity-common .item-rarity { color: #cbd5e1; }

.item-rarity-rare { border-left-color: #4ade80; background: linear-gradient(90deg, rgba(74, 222, 128, 0.05) 0%, transparent 100%); }
.item-rarity-rare .item-rarity { color: #4ade80; text-shadow: 0 0 5px rgba(74, 222, 128, 0.5); }

.item-rarity-epic { border-left-color: #d946ef; background: linear-gradient(90deg, rgba(217, 70, 239, 0.05) 0%, transparent 100%); }
.item-rarity-epic .item-rarity { color: #d946ef; text-shadow: 0 0 5px rgba(217, 70, 239, 0.5); }

.item-rarity-legendary { 
    border-left-color: #fbbf24;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.1) 0%, transparent 100%);
    border-top: 1px solid rgba(251, 191, 36, 0.3);
    border-bottom: 1px solid rgba(251, 191, 36, 0.3);
    border-right: 1px solid rgba(251, 191, 36, 0.3);
}
.item-rarity-legendary .item-rarity { color: #fbbf24; font-weight: bold; animation: textPulse 1s infinite alternate; }

/* --- NUEVO: DETALLE MODAL ESTILOS --- */

#item-detail-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Un poco más transparente para ver atrás */
    z-index: 2000; /* Encima del inventario normal */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

#item-detail-overlay.hidden {
    display: none;
}

#detail-card {
    width: 300px;
    background: #1a1a20;
    border: 4px solid #fff;
    outline: 4px solid #000;
    padding: 20px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    font-family: 'Press Start 2P', cursive;
    color: white;
    text-align: center;
    animation: detailPop 0.3s ease-out;
}

@keyframes detailPop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#detail-close {
    position: absolute;
    bottom: -50px; /* Botón flotante abajo */
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: white;
    border: 4px solid #000;
    font-family: 'Press Start 2P', cursive;
    padding: 10px 20px;
    cursor: pointer;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
}

#detail-close:active {
    transform: translateX(-50%) translateY(4px);
    box-shadow: 0 0 0 rgba(0,0,0,0.5);
}

#detail-rarity-badge {
    display: inline-block;
    padding: 6px 10px;
    background: #333;
    border: 2px solid #555;
    font-size: 10px;
    margin-bottom: 15px;
    text-transform: uppercase;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

#detail-name {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 20px 0;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

.detail-image-wrapper {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px auto;
    background: #000;
    border: 4px solid rgba(255,255,255,0.1);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.detail-bg-glow {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0.2;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
}

#detail-image {
    width: 96px;
    height: 96px;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(4px 4px 0 rgba(0,0,0,0.5));
    animation: pixelFloat 3s infinite ease-in-out;
}

.detail-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-box {
    background: #2a2a35;
    border: 2px solid #000;
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

.stat-value {
    font-size: 12px;
    color: #fff;
}

.detail-flavor {
    font-size: 9px;
    line-height: 1.6;
    color: #aaa;
    font-style: italic;
    border-top: 2px solid #333;
    padding-top: 15px;
}

/* --- ESTILOS DINÁMICOS POR RAREZA EN EL DETALLE --- */
/* LEGENDARY */
.detail-legendary #detail-card { border-color: #fbbf24; }
.detail-legendary #detail-rarity-badge { background: #fbbf24; color: #451a03; border-color: #fff; animation: textPulse 1s infinite alternate; }
.detail-legendary .detail-bg-glow { background: radial-gradient(circle, #fbbf24 0%, transparent 70%); opacity: 0.4; }
.detail-legendary #detail-name { color: #fbbf24; }

/* EPIC */
.detail-epic #detail-card { border-color: #d946ef; }
.detail-epic #detail-rarity-badge { background: #d946ef; color: #fff; border-color: #fae8ff; }
.detail-epic .detail-bg-glow { background: radial-gradient(circle, #d946ef 0%, transparent 70%); opacity: 0.3; }
.detail-epic #detail-name { color: #d946ef; }

/* RARE */
.detail-rare #detail-card { border-color: #4ade80; }
.detail-rare #detail-rarity-badge { background: #4ade80; color: #064e3b; border-color: #dcfce7; }
.detail-rare .detail-bg-glow { background: radial-gradient(circle, #4ade80 0%, transparent 70%); opacity: 0.3; }
.detail-rare #detail-name { color: #4ade80; }

/* COMMON */
.detail-common #detail-card { border-color: #94a3b8; }
.detail-common #detail-rarity-badge { background: #94a3b8; color: #1e293b; }

@media (max-width: 600px) {
    #inventory-panel {
        width: 95%;
        height: 80vh; 
        padding: 16px;
    }
    .inventory-header h2 { font-size: 14px; }
    .inventory-item { padding: 14px; }
    .item-name { font-size: 10px; }
}

/* --- UniFish Fish Hold Accent --- */
#inventory-panel {
    border-color: #00f5ff;
    box-shadow: 0 0 0 4px #000, 0 0 24px rgba(0, 245, 255, 0.28), 12px 12px 0 rgba(0,0,0,0.5);
}

.inventory-header h2 {
    color: #00f5ff;
}

.inventory-header h2::after {
    content: "  CATCH VAULT";
    color: #d946ef;
    font-size: 8px;
}

.inventory-item::after {
    content: "FISH";
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 4px;
    border: 1px solid #00f5ff;
    color: #00f5ff;
    background: #020617;
    font-size: 6px;
}

.item-count {
    background: #111827;
    border-color: #00f5ff;
    color: #00f5ff;
}

#detail-card {
    border-color: #00f5ff !important;
    box-shadow: 0 0 0 4px #000, 0 0 22px rgba(217, 70, 239, 0.35), 10px 10px 0 rgba(0,0,0,0.55) !important;
}
