/* Shop Modal Styles */

/* Modal Container */
#shop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#shop-modal.hidden {
    display: none;
    opacity: 0;
}

/* Modal Content */
.shop-content {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 2px solid #8a2be2;
    border-radius: 15px;
    padding: 20px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.5);
}

/* Shop Header */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-title {
    font-size: 28px;
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    text-shadow: 0 0 10px #8a2be2;
    margin: 0;
}

/* Coins Display */
.shop-coins {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-family: 'Orbitron', sans-serif;
    color: #FFD700;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #FFD700;
}

.shop-coins .coin-icon {
    font-size: 28px;
}

/* Tabs */
.shop-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.shop-tab-btn {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #aaa;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-tab-btn:hover {
    border-color: #8a2be2;
    color: #fff;
}

.shop-tab-btn.active {
    background: linear-gradient(135deg, #8a2be2 0%, #6a1bb2 100%);
    border-color: #8a2be2;
    color: white;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

/* Tab Content Area */
.shop-tab-content {
    min-height: 300px;
    margin-bottom: 20px;
}

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

/* Individual Item */
.shop-item {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.shop-item:hover {
    border-color: #8a2be2;
    transform: scale(1.05);
}

.shop-item.selected {
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.shop-item.purchased {
    border-color: #00ff88;
    opacity: 0.6;
}

.shop-item.purchased::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    color: #00ff88;
    font-size: 16px;
    font-weight: bold;
}

.shop-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

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

.shop-item-name {
    font-size: 11px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-item-price {
    font-size: 12px;
    color: #FFD700;
    font-family: 'Orbitron', sans-serif;
}

.shop-item-price.cant-afford {
    color: #ff4444;
}

/* Tier Indicator */
.tier-indicator {
    display: flex;
    gap: 3px;
    justify-content: center;
    margin-top: 5px;
}

.tier-pip {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tier-pip.filled {
    background: #FFD700;
    border-color: #FFD700;
    box-shadow: 0 0 5px #FFD700;
}

/* Stats List */
.shop-stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-stat-item {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-stat-item:hover {
    border-color: #8a2be2;
}

.shop-stat-item.selected {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.shop-stat-item.maxed {
    opacity: 0.6;
    cursor: not-allowed;
}

.shop-stat-icon {
    font-size: 28px;
    width: 40px;
    text-align: center;
}

.shop-stat-info {
    flex: 1;
}

.shop-stat-name {
    font-size: 14px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 5px;
}

.shop-stat-desc {
    font-size: 11px;
    color: #aaa;
}

/* Progress Bar */
.stat-progress {
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.stat-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88 0%, #00d4ff 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.shop-stat-price {
    font-size: 14px;
    color: #FFD700;
    font-family: 'Orbitron', sans-serif;
    min-width: 80px;
    text-align: right;
}

.shop-stat-price.cant-afford {
    color: #ff4444;
}

.shop-stat-price.maxed {
    color: #00ff88;
}

/* Preview Panel */
.shop-preview {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    min-height: 120px;
    margin-bottom: 15px;
}

.preview-hint {
    color: #666;
    font-size: 14px;
    text-align: center;
    font-style: italic;
}

.preview-title {
    font-size: 18px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-icon {
    font-size: 24px;
}

.preview-description {
    color: #aaa;
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.preview-details {
    color: #00d4ff;
    font-size: 12px;
}

/* Action Buttons */
.shop-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.shop-buy-btn {
    padding: 12px 30px;
    font-size: 16px;
    background: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
    border: none;
    border-radius: 8px;
    color: #000;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-buy-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.shop-buy-btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}

.shop-close-btn {
    padding: 12px 30px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

/* Difficulty Toggles */
.shop-difficulty-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-difficulty-item {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-difficulty-item:hover {
    border-color: #8a2be2;
}

.shop-difficulty-item.active {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.shop-difficulty-item.locked {
    opacity: 0.4;
}

.difficulty-toggle {
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    position: relative;
    transition: all 0.3s ease;
}

.difficulty-toggle::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.shop-difficulty-item.active .difficulty-toggle {
    background: #ff4444;
}

.shop-difficulty-item.active .difficulty-toggle::after {
    left: 26px;
}

.difficulty-info {
    flex: 1;
}

.difficulty-name {
    font-size: 14px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 3px;
}

.difficulty-effect {
    font-size: 11px;
    color: #aaa;
}

.difficulty-bonus {
    font-size: 14px;
    color: #00ff88;
    font-family: 'Orbitron', sans-serif;
}

/* Lives Section */
.shop-lives-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.shop-lives-item {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-lives-item:hover:not(.purchased):not(.locked) {
    border-color: #8a2be2;
    transform: scale(1.02);
}

.shop-lives-item.selected {
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.shop-lives-item.purchased {
    border-color: #00ff88;
    opacity: 0.7;
}

.shop-lives-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.lives-hearts {
    font-size: 32px;
    margin-bottom: 10px;
}

.lives-name {
    font-size: 14px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 5px;
}

.lives-desc {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 10px;
}

.lives-price {
    font-size: 16px;
    color: #FFD700;
    font-family: 'Orbitron', sans-serif;
}

.lives-price.cant-afford {
    color: #ff4444;
}

/* Special Upgrades */
.shop-specials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.shop-special-item {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-special-item:hover:not(.purchased) {
    border-color: #8a2be2;
    transform: scale(1.02);
}

.shop-special-item.selected {
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.shop-special-item.purchased {
    border-color: #00ff88;
    opacity: 0.7;
}

.special-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.special-name {
    font-size: 13px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 5px;
}

.special-desc {
    font-size: 10px;
    color: #aaa;
    margin-bottom: 10px;
    line-height: 1.3;
}

.special-price {
    font-size: 14px;
    color: #FFD700;
    font-family: 'Orbitron', sans-serif;
}

.special-price.cant-afford {
    color: #ff4444;
}

/* HUD Coins Display (during game) */
.hud-coins {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid #FFD700;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: #FFD700;
    z-index: 100;
}

.hud-coins .coin-icon {
    font-size: 20px;
}

/* Extra Lives HUD (during game) */
.hud-lives {
    position: fixed;
    top: 50px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid #ff4444;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: #ff4444;
    z-index: 100;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .shop-content {
        padding: 15px;
        max-height: 95vh;
    }

    .shop-title {
        font-size: 20px;
    }

    .shop-coins {
        font-size: 18px;
        padding: 8px 15px;
    }

    .shop-tab-btn {
        padding: 8px 10px;
        font-size: 10px;
    }

    .shop-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .shop-item-icon {
        font-size: 24px;
    }

    .shop-item-name {
        font-size: 9px;
    }

    .shop-lives-list {
        grid-template-columns: 1fr;
    }

    .shop-specials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-actions {
        flex-direction: column;
    }

    .shop-buy-btn,
    .shop-close-btn {
        width: 100%;
    }
}
