/* =============================================================================
   ENHANCED SHOP SYSTEM STYLES
   Beautiful, modern shop interface with improved UX
   ============================================================================= */

/* Shop Modal Base */
.shop-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shop-modal.show {
    opacity: 1;
}

.shop-content {
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Shop Header */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.shop-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.shop-icon {
    font-size: 2rem;
    animation: shopPulse 2s ease-in-out infinite;
}

@keyframes shopPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.shop-title h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gil Balance Display */
.shop-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.balance-label {
    font-size: 1rem;
    color: #cbd5e1;
    font-weight: 500;
}

.balance-amount {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.gil-icon {
    font-size: 1.5rem;
    animation: goldShine 3s ease-in-out infinite;
}

@keyframes goldShine {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.5);
    }
}

.gil-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.gil-text {
    font-size: 0.875rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Shop Controls */
.shop-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

/* Category Buttons */
.shop-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.category-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.cat-icon {
    font-size: 1.25rem;
}

/* Sort Dropdown */
.shop-sort {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shop-sort label {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

.shop-sort select {
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-sort select:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.1);
}

.shop-sort select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Shop Items Container */
.shop-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

.shop-items-container::-webkit-scrollbar {
    width: 8px;
}

.shop-items-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

.shop-items-container::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

.shop-items-container::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* Shop Items Grid */
.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Shop Item Card */
.shop-item-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.shop-item-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.shop-item-card.unaffordable {
    opacity: 0.6;
    border-color: rgba(239, 68, 68, 0.3);
}

.shop-item-card.purchase-success {
    animation: purchaseSuccess 1s ease;
}

@keyframes purchaseSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
        border-color: #22c55e;
    }
    100% {
        transform: scale(1);
    }
}

/* Item Card Header */
.item-card-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.item-emoji {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.permanent-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.rarity-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rarity-common {
    background: rgba(156, 163, 175, 0.2);
    border: 1px solid #9ca3af;
    color: #d1d5db;
}

.rarity-uncommon {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid #22c55e;
    color: #86efac;
}

.rarity-rare {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid #3b82f6;
    color: #93c5fd;
}

.rarity-legendary {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(217, 70, 239, 0.2));
    border: 1px solid #a855f7;
    color: #e9d5ff;
    animation: legendaryGlow 2s ease-in-out infinite;
}

@keyframes legendaryGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.8);
    }
}

/* Item Card Body */
.item-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-name {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #e2e8f0;
}

.item-description {
    margin: 0;
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.5;
}

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

.effect {
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.effect.positive {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.effect.negative {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.permanent-note {
    padding: 0.5rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #fbbf24;
    text-align: center;
}

/* Item Card Footer */
.item-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
}

.item-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-icon {
    font-size: 1.25rem;
}

.price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fbbf24;
}

.price-label {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Buy Button */
.buy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.buy-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.buy-btn:active:not(.disabled) {
    transform: translateY(0);
}

.buy-btn.disabled {
    background: rgba(100, 116, 139, 0.3);
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    font-size: 1rem;
}

/* Shop Footer */
.shop-footer {
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
}

.shop-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #94a3b8;
}

.shop-info strong {
    color: #3b82f6;
}

/* Confirmation Modal */
.confirmation-modal {
    z-index: 10000;
}

.confirmation-content {
    max-width: 400px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    overflow: hidden;
}

.confirmation-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.confirmation-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #e2e8f0;
}

.confirmation-body {
    padding: 1.5rem;
}

.confirm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.confirm-emoji {
    font-size: 4rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.confirm-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e2e8f0;
}

.confirm-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
}

.permanent-notice {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 8px;
    font-size: 0.875rem;
    color: #fbbf24;
    text-align: center;
}

.confirmation-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
}

.btn-cancel, .btn-confirm {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel {
    background: rgba(100, 116, 139, 0.2);
    border: 1px solid rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
}

.btn-cancel:hover {
    background: rgba(100, 116, 139, 0.3);
    transform: translateY(-2px);
}

.btn-confirm {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Empty State */
.shop-empty {
    text-align: center;
    padding: 3rem;
    color: #64748b;
    font-size: 1.125rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .shop-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .shop-items-grid {
        grid-template-columns: 1fr;
    }
    
    .shop-categories {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .shop-balance {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .shop-controls {
        padding: 1rem;
    }
    
    .shop-items-container {
        padding: 1rem;
    }
}