/* vars */
:root {
    --cyber-bg: #121212;
    --cyber-text: #e0e0e0;
    --cyber-accent: #00ff99;
    --cyber-accent-dark: #00cc7a;
    --cyber-button-bg: #ff0066;
    --cyber-button-bg-hover: #e6005c;
    --cyber-secondary-bg: #333;
    --cyber-secondary-bg-hover: #555;
    --cyber-input-bg: #1e1e1e;
    --cyber-input-border: #555;
    --cyber-input-border-focus: #00ff99;
    --cyber-alert-error-bg: #ff0044;
    --cyber-alert-success-bg: #00cc7a;
    --cyber-alert-info-bg: #0066ff;
    --cyber-alert-warning-bg: #ff9900;
}




.store-main {
    background-color: var(--cyber-bg);
    color: var(--cyber-text);
    /* cyberpunky font - using web-safe alternative */
    font-family: 'Courier New', 'Monaco', monospace;
    padding: 20px;
    border: 3px solid var(--cyber-accent);
    border-radius: 10px;
    margin: 20px;
    box-shadow: 
        0 0 20px rgba(0, 255, 153, 0.3),
        inset 0 0 0 2px rgba(0, 255, 153, 0.2),
        inset 0 0 0 8px var(--cyber-bg),
        inset 0 0 0 11px rgba(0, 255, 153, 0.4);
    position: relative;
}

.store-main::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid rgba(0, 255, 153, 0.15);
    border-radius: 7px;
    pointer-events: none;
}

.productGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    /* Performance optimization */
    contain: layout;
}

/* Adjust grid for different product counts */
@supports (display: grid) {
    .productGrid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Ensure products don't stretch too wide when there are few items */
@media (min-width: 768px) {
    .productGrid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (min-width: 1200px) {
    .productGrid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.productCard {
    background-color: var(--cyber-secondary-bg);
    border: 2px solid var(--cyber-accent);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 10px rgba(0, 255, 153, 0.2),
        inset 0 0 0 1px rgba(0, 255, 153, 0.3),
        inset 0 0 0 4px var(--cyber-secondary-bg),
        inset 0 0 0 6px rgba(0, 255, 153, 0.5);
    /* Performance: Use will-change and reduce animations off-screen */
    will-change: transform;
    contain: layout style paint;
    /* Cyberpunk clip-path - slanted edges */
    clip-path: polygon(
        15px 0,
        100% 0,
        100% calc(100% - 15px),
        calc(100% - 15px) 100%,
        0 100%,
        0 15px
    );
    position: relative;
}

.productCard::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px solid rgba(0, 255, 153, 0.2);
    border-radius: 6px;
    pointer-events: none;
    clip-path: polygon(
        13px 0,
        100% 0,
        100% calc(100% - 13px),
        calc(100% - 13px) 100%,
        0 100%,
        0 13px
    );
}

.productCard:hover {
    background-color: var(--cyber-secondary-bg-hover);
    border-color: var(--cyber-button-bg);
    box-shadow: 
        0 0 20px rgba(255, 0, 102, 0.4),
        0 0 30px rgba(255, 0, 102, 0.2),
        inset 0 0 0 1px rgba(255, 0, 102, 0.4),
        inset 0 0 0 4px var(--cyber-secondary-bg-hover),
        inset 0 0 0 6px rgba(255, 0, 102, 0.6);
    transform: translateY(-5px);
    /* Enable animation only on hover */
    animation: neonFlicker 1.5s infinite;
}

.productCard:hover::before {
    border-color: rgba(255, 0, 102, 0.3);
}

.productCard img {
    max-width: 100%;
    border-radius: 4px;
    margin-bottom: 10px;
    /* Optimize image rendering - reduce paint operations */
    will-change: opacity;
    content-visibility: auto;
    /* Lazy load images for performance */
    loading: lazy;
}

.productCard h3 {
    color: var(--cyber-accent);
    text-shadow: 0 0 5px rgba(0, 255, 153, 0.5);
    margin: 10px 0;
}

.productPrice {
    color: var(--cyber-button-bg);
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 0 0 5px rgba(255, 0, 102, 0.3);
}

.productCard p {
    font-size: 1rem;
    color: var(--cyber-text);
    margin: 10px 0;
}

.storeheading {
    text-align: center;
    margin-bottom: 40px;
}

.storeheading h2 {
    color: var(--cyber-accent);
    text-shadow: 0 0 10px rgba(0, 255, 153, 0.5);
    font-size: 2em;
    margin-bottom: 10px;
}

.storeheading p {
    color: var(--cyber-text);
    font-size: 1.1em;
}

.buyButton {
    background-color: var(--cyber-button-bg);
    color: white;
    border: 2px solid var(--cyber-button-bg);
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    will-change: background-color, box-shadow;
}

.buyButton:hover {
    background-color: var(--cyber-button-bg-hover);
    border-color: var(--cyber-accent);
    box-shadow: 0 0 15px rgba(255, 0, 102, 0.6), inset 0 0 10px rgba(0, 255, 153, 0.2);
    transform: scale(1.05);
}

.buyButton:active {
    transform: scale(0.98);
}

/* Sold Out Product Styles */
.productCard.soldOut {
    opacity: 0.6;
    border-color: var(--cyber-alert-error-bg);
    background-color: rgba(255, 0, 68, 0.1);
    position: relative;
}

.productCard.soldOut .productImage {
    filter: grayscale(100%);
    opacity: 0.5;
}

.soldOutBadge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--cyber-alert-error-bg);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.85em;
    letter-spacing: 1px;
    z-index: 10;
    box-shadow: 0 0 10px rgba(255, 0, 68, 0.6);
}

.productCard.soldOut .buyButton:disabled {
    background-color: #555;
    border-color: #555;
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
    text-decoration: line-through;
}

.productCard.soldOut .buyButton:disabled:hover {
    background-color: #555;
    border-color: #555;
    box-shadow: none;
    transform: none;
}
    font-weight: bold;
    color: #00ff99;
    margin-top: 10px;
}
.productCard button {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #00ff99;
    border: none;
    border-radius: 4px;
    color: #121212;
    font-weight: bold;
    cursor: pointer;
}
.productCard button:hover {
    background-color: #00cc7a;
}
/* ============================================
   ADDITIONAL STYLES
   ============================================ */
.button-primary {
    background-color: #ff0066;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}   
.button-primary:hover {
    background-color: #e6005c;
}
.button-secondary {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.button-secondary:hover {
    background-color: #555;
}
.input-field {
    width: 100%;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-size: 1rem;
}
.input-field:focus {
    border-color: #00ff99;
    outline: none;
    box-shadow: 0 0 5px #00ff99;
}
.input-field::placeholder {
    color: #777;
}
.alert {
    background-color: #ff0044;
    color: #fff;
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}
.alert.success {
    background-color: #00cc7a;
}
.alert.info {
    background-color: #0066ff;
}
.alert.warning {
    background-color: #ff9900;
}

/*animation for neon flicker */
@keyframes neonFlicker {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 153, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 153, 0.5);
    }
}
@media (max-width: 600px) {
    .productGrid {
        grid-template-columns: 1fr;
    }
}

/* Popup/Modal Styles */
.full-screen-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.full-screen-popup.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-content {
    background-color: var(--cyber-bg);
    border: 2px solid var(--cyber-button-bg);
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 
        0 0 20px rgba(255, 0, 102, 0.4),
        inset 0 0 20px rgba(255, 0, 102, 0.1);
    animation: slideIn 0.3s ease;
    /* Cyberpunk clip-path - angled corners */
    clip-path: polygon(
        20px 0,
        100% 0,
        100% calc(100% - 20px),
        calc(100% - 20px) 100%,
        0 100%,
        0 20px
    );
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.popup-content h2 {
    color: var(--cyber-button-bg);
    text-shadow: 0 0 10px rgba(255, 0, 102, 0.5);
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.popup-content p {
    color: var(--cyber-text);
    font-size: 1rem;
    line-height: 1.6;
    margin: 10px 0;
}

.popup-content .disclamer {
    color: var(--cyber-alert-warning-bg);
    font-size: 0.9em;
    border-left: 3px solid var(--cyber-alert-warning-bg);
    padding-left: 15px;
    margin-top: 20px;
    font-style: italic;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2em;
    color: var(--cyber-button-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-popup:hover {
    color: var(--cyber-accent);
    text-shadow: 0 0 10px rgba(0, 255, 153, 0.6);
    transform: scale(1.2) rotate(90deg);
}

.popup-content button {
    background-color: var(--cyber-button-bg);
    color: white;
    border: 2px solid var(--cyber-button-bg);
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    margin-right: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.popup-content button:hover {
    background-color: var(--cyber-button-bg-hover);
    box-shadow: 0 0 15px rgba(255, 0, 102, 0.6);
}

.popup-content button:last-child {
    background-color: transparent;
    border-color: var(--cyber-accent);
    color: var(--cyber-accent);
}

.popup-content button:last-child:hover {
    background-color: var(--cyber-accent);
    color: var(--cyber-bg);
    box-shadow: 0 0 15px rgba(0, 255, 153, 0.6);
}   
/* ============================================
   MEDIA QUERIES
   ============================================ */
@media (max-width: 768px) {
    .store-main {
        padding: 10px;
    }
    .productCard {
        padding: 10px;
    }
    .storeheading h2 {
        font-size: 1.5em;
    }
}
/* resource saving when not visible */
@media (prefers-reduced-motion: reduce) {
    .productCard, .button-primary, .button-secondary {
        animation: none !important;
        transition: none !important;
    }
}
 @media (prefers-high-contrast: high) {
    .store-main {
        background-color: #000;
        color: #fff;
    }
    .productCard {
        border-color: #fff;
        background-color: #000;
    }
    .button-primary, .button-secondary {
        background-color: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    .input-field {
        background-color: #000;
        color: #fff;
        border-color: #fff;
    }
}   
}   

/* Hidden box styles */
.hidden-box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 18, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease;
    backdrop-filter: blur(5px);
}

.hidden-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid var(--cyber-accent);
    border-radius: 10px;
    padding: 40px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 
        0 0 20px var(--cyber-accent),
        0 0 40px rgba(0, 255, 153, 0.2),
        inset 0 0 20px rgba(0, 255, 153, 0.05);
    animation: slideIn 0.6s ease;
    position: relative;
}

.hidden-content h2 {
    color: var(--cyber-accent);
    text-shadow: 0 0 10px var(--cyber-accent);
    font-size: 2rem;
    margin-top: 0;
    text-align: center;
    animation: neon-flicker 3s infinite alternate;
}

.hidden-content p {
    color: var(--cyber-text);
    line-height: 1.8;
    margin: 15px 0;
    font-size: 1.1rem;
}

.holo-message {
    background: rgba(0, 255, 153, 0.05);
    border-left: 4px solid var(--cyber-accent);
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: inset 0 0 10px rgba(0, 255, 153, 0.1);
}

.holo-message p {
    margin: 10px 0;
    font-family: 'Courier New', monospace;
}

.close-hidden-btn {
    display: block;
    margin: 30px auto 0;
    padding: 12px 30px;
    background: var(--cyber-button-bg);
    color: #fff;
    border: 2px solid var(--cyber-button-bg);
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 0, 102, 0.4);
}

.close-hidden-btn:hover {
    background: var(--cyber-button-bg-hover);
    border-color: var(--cyber-button-bg-hover);
    box-shadow: 0 0 20px rgba(255, 0, 102, 0.6);
    transform: translateY(-2px);
}

.close-hidden-btn:active {
    transform: translateY(0);
}

/* Animations */
@keyframes neon-flicker {
    0%, 100% {
        text-shadow: 0 0 10px var(--cyber-accent);
    }
    50% {
        text-shadow: 0 0 20px var(--cyber-accent), 0 0 30px rgba(0, 255, 153, 0.5);
    }
}

/* End of cyberpunkstore.css */
