/* ========================
   STORE MODAL ENHANCEMENTS
   ======================== */

/* Store Modal Content */
.store-content {
    max-width: 900px;
    width: 95vw;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(44, 62, 80, 0.95), rgba(52, 73, 94, 0.95));
    border: 2px solid var(--gold-color);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Store Tabs */
.store-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 2px solid rgba(240, 195, 60, 0.3);
    padding-bottom: 15px;
}

.store-tab {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 160px;
    position: relative;
}

.store-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.store-tab.active {
    background: var(--treasure-gradient);
    color: var(--dark-color);
    border-color: var(--gold-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.store-tab.active:hover {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    transform: translateY(-1px);
}

/* Tab Content */
.store-tab-content {
    display: none !important;
    animation: fadeIn 0.3s ease-in-out;
}

.store-tab-content.active {
    display: flex !important;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Store Section Enhancements */
.store-section {
    margin-bottom: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.store-section .section-title {
    color: var(--gold-color);
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    margin: 0 0 8px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid rgba(240, 195, 60, 0.3);
}

.store-section .section-description {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin: 0 0 15px 0;
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 8px 8px;
}

/* Store Cards Container */
.store-cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    gap: 15px;
    padding: 15px;
    flex: 1;
    align-content: start;
    overflow-y: auto;
    max-height: 400px;
}

/* Premium cards - 3 cards in 2 columns */
.premium-cards {
    grid-template-columns: 1fr 1fr;
}

.premium-cards .store-card-wrapper:nth-child(3) {
    grid-column: 1;
}

/* Risk & Reward section with 5 cards */
.risk-reward-cards {
    grid-template-columns: 1fr 1fr;
    max-height: 400px;
    overflow-y: auto;
}

.risk-reward-cards .store-card-wrapper:nth-child(5) {
    grid-column: 1;
}

.store-card-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-width: 140px;
    text-align: center;
}

.store-card-wrapper:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--gold-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Purchased card styling */
.store-card-wrapper.purchased {
    opacity: 0.6;
    background: rgba(100, 100, 100, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
    position: relative;
}

.store-card-wrapper.purchased::before {
    content: "SOLD";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    z-index: 10;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    border: 2px solid #e74c3c;
}

.store-card-wrapper.purchased:hover {
    transform: none;
    background: rgba(100, 100, 100, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.store-card-wrapper.purchased .purchase-button {
    background: rgba(100, 100, 100, 0.5);
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(100, 100, 100, 0.5);
    cursor: not-allowed;
    pointer-events: none;
}

/* Purchase Button Enhancements */
.purchase-button {
    background: var(--treasure-gradient);
    color: var(--dark-color);
    border: 2px solid var(--gold-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-size: 0.9rem;
}

.purchase-button:hover {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.purchase-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.purchase-button:disabled {
    background: rgba(100, 100, 100, 0.5);
    color: rgba(255, 255, 255, 0.5);
    border-color: rgba(100, 100, 100, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Store Card Cost */
.store-card-cost {
    color: var(--gold-color);
    font-weight: bold;
    font-size: 1rem;
    margin-top: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Premium Card Styling */
.premium-card {
    border: 2px solid var(--gold-color);
    box-shadow: 0 0 10px rgba(240, 195, 60, 0.3);
}

/* ========================
   MOBILE OPTIMIZATION
   ======================== */

@media (max-width: 767px) {
    #store-modal .modal-content {
        max-height: 100vh !important;
        padding: 15px 10px !important;
    }
    
    .store-cards-container {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
        padding: 10px;
    }
    
    .premium-cards {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .risk-reward-cards {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 480px) {
    .store-content {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 10px;
    }

    .store-tabs {
        margin: 10px 0;
        gap: 6px;
    }

    .store-tab {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .store-cards-container {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px;
        padding: 8px;
    }
    
    .premium-cards {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .risk-reward-cards {
        grid-template-columns: 1fr 1fr !important;
    }

    .store-card-wrapper {
        padding: 8px;
    }

    .purchase-button {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .store-section .section-title {
        font-size: 1rem;
        padding: 6px;
    }

    .store-section .section-description {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}

/* ========================
   SCROLLBAR STYLING
   ======================== */

.store-content::-webkit-scrollbar {
    width: 8px;
}

.store-content::-webkit-scrollbar-track {
    background: rgba(44, 62, 80, 0.3);
    border-radius: 4px;
}

.store-content::-webkit-scrollbar-thumb {
    background: var(--gold-color);
    border-radius: 4px;
    opacity: 0.7;
}

.store-content::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* Card container scrollbars */
.store-cards-container::-webkit-scrollbar {
    width: 6px;
}

.store-cards-container::-webkit-scrollbar-track {
    background: rgba(44, 62, 80, 0.3);
    border-radius: 3px;
}

.store-cards-container::-webkit-scrollbar-thumb {
    background: var(--gold-color);
    border-radius: 3px;
    opacity: 0.7;
}

.store-cards-container::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* Price increase animation */
@keyframes priceIncrease {
    0% {
        transform: scale(1);
        color: var(--gold-color);
    }
    50% {
        transform: scale(1.2);
        color: #e74c3c;
    }
    100% {
        transform: scale(1);
        color: #e74c3c;
    }
}
