:root {
    --primary-bg: #0D1117;
    --secondary-bg: #161B22;
    --glass-bg: rgba(22, 27, 34, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);

    --accent-green: #00f260;
    --accent-blue: #00c6ff;
    --accent-gold: #FFD700;
    --accent-red: #ff4757;

    --font-family: 'Poppins', sans-serif;

    --primary-gradient: linear-gradient(45deg, var(--accent-green), #0575e6);
    --primary-glow-lite: 0 4px 15px rgba(0, 242, 96, 0.2), 0 4px 15px rgba(5, 117, 230, 0.2);
    --primary-glow-strong: 0 6px 25px rgba(0, 242, 96, 0.4), 0 6px 25px rgba(5, 117, 230, 0.3);

    --glow-effect-light: 0 0 10px rgba(0, 242, 96, 0.4), 0 0 20px rgba(0, 242, 96, 0.2);
}

@keyframes backgroundPan {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes titleUnderlineShine {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

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

@keyframes shimmer {
    0% { transform: translateX(-100%) skewX(-20deg); }
    100% { transform: translateX(200%) skewX(-20deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.1); opacity: 0.8; }
}

body {
    background-color: var(--primary-bg);
    background-image: radial-gradient(circle at 15% 15%, rgba(0, 242, 96, 0.08) 0%, rgba(0, 242, 96, 0) 35%),
                      radial-gradient(circle at 85% 80%, rgba(5, 117, 230, 0.08) 0%, rgba(5, 117, 230, 0) 30%);
    background-size: 200% 200%;
    animation: backgroundPan 25s linear infinite;
    font-family: var(--font-family);
    color: #E0E6ED;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

body.content-blurred #store-wrapper {
    filter: blur(5px);
    transform: scale(0.98);
    pointer-events: none;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000; backdrop-filter: blur(12px);
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.visible { opacity: 1; visibility: visible; }

.modal-content {
    background: var(--secondary-bg);
    padding: 2.5rem; border-radius: 1rem;
    text-align: center; max-width: 420px; width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--accent-green);
    transform: scale(0.9); opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    position: relative;
}

.modal-overlay.visible .modal-content { transform: scale(1); opacity: 1; }

.login-logo { width: 100px; margin-bottom: 1rem; }
.modal-content h2 { font-size: 2rem; margin-bottom: 0.5rem; color: #FFF; font-weight: 700; }
.modal-content p { color: #A0AABA; margin-bottom: 1.5rem; font-size: 1rem; }

.modal-content form input {
    width: 100%; padding: 0.9rem; font-size: 1rem;
    border-radius: 8px; border: 1px solid #444;
    background: var(--primary-bg); color: #E0E6ED;
    margin-bottom: 1rem; text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-content form input:focus {
    outline: none; border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 242, 96, 0.3);
}

.modal-content form button {
    width: 100%; padding: 0.9rem; font-size: 1.1rem; font-weight: 700;
    background-image: var(--primary-gradient);
    color: white; border: none; border-radius: 8px; cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--primary-glow-lite);
}

.modal-content form button:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: var(--primary-glow-strong);
}

#store-wrapper { 
    flex-grow: 1;
    padding-bottom: 140px; 
    transition: filter 0.3s ease, transform 0.3s ease; 
}
#store-wrapper.hidden { display: none; }

.products-area { 
    display: flex; flex-direction: column; gap: 3.5rem; 
    padding: 2.5rem; max-width: 1200px; margin: 0 auto; 
}
.store-title { 
    font-size: 2.8rem; font-weight: 800; text-transform: uppercase; 
    text-align: center; margin-bottom: 2rem; padding-bottom: 1.2rem; 
    border-bottom: 2px solid var(--border-color); color: white;
    letter-spacing: 1.5px;
    position: relative;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
    opacity: 0;
    animation: cardFadeUp 0.6s 0.1s ease-out forwards;
}
.store-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-green), #0575e6, var(--accent-green), transparent);
    background-size: 200% 100%;
    animation: titleUnderlineShine 3s linear infinite;
}

.products-grid { 
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 2.5rem; 
}

.product-card {
    background: var(--secondary-bg); border-radius: 1rem;
    border: 1px solid var(--border-color);
    border-top: 5px solid var(--accent-green); 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex; flex-direction: column; position: relative;
    overflow: hidden; 
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    opacity: 0;
    animation: cardFadeUp 0.6s ease-out forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

.product-card:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 15px 40px rgba(0, 242, 96, 0.15); 
    border-color: rgba(0, 242, 96, 0.4);
}

.product-card.unavailable { 
    filter: grayscale(0.8); 
    opacity: 0.7; 
    pointer-events: none; 
    border-top-color: var(--accent-red) !important; 
    position: relative;
}

.product-card.unavailable::before {
    content: '\f00d'; 
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12rem;
    color: rgba(255, 71, 87, 0.12); 
    z-index: 1;
    pointer-events: none; 
}

.product-header { padding: 1.8rem; text-align: center; }
.product-name { font-size: 2.2rem; font-weight: 700; text-transform: uppercase; color: white; letter-spacing: 0.5px; }
.product-price { font-size: 1.4rem; font-weight: 600; margin-top: 0.4rem; }
.product-price .monthly { font-size: 0.9rem; font-weight: 400; color: #A0AABA; margin-left: 5px;}

.product-features { padding: 0 1.8rem 1.8rem; list-style: none; flex-grow: 1; }
.product-features li { 
    padding: 0.8rem 0; 
    border-bottom: 1px solid #282f3a; 
    font-size: 1rem; 
    display: flex;
    align-items: center;
    color: #C0CADA;
}
.product-features li:last-child { border-bottom: none; }
.product-features li::before {
    content: ''; 
    display: inline-block;
    width: 12px;
    height: 12px;
    min-width: 12px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green), 0 0 15px var(--accent-green);
    margin-right: 1rem;
    animation: pulse 1.5s infinite alternate;
}

.product-card.accent-blue { border-top-color: var(--accent-blue); }
.product-card.accent-blue:hover { 
    box-shadow: 0 15px 40px rgba(0, 198, 255, 0.15); 
    border-color: rgba(0, 198, 255, 0.4); 
}
.product-card.accent-blue li::before { 
    background-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue), 0 0 15px var(--accent-blue);
}

.product-card.accent-gold { border-top-color: var(--accent-gold); }
.product-card.accent-gold:hover { 
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.15); 
    border-color: rgba(255, 215, 0, 0.4); 
}
.product-card.accent-gold li::before { 
    background-color: var(--accent-gold);
    box-shadow: 0 0 8px var(--accent-gold), 0 0 15px var(--accent-gold);
}

.add-to-cart-btn {
    background-image: var(--primary-gradient); 
    color: white; 
    border: none; 
    padding: 1.1rem;
    font-size: 1.1rem; 
    font-weight: 700; 
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background-image 0.3s ease; 
    margin-top: auto;
    border-bottom-left-radius: 1rem; 
    border-bottom-right-radius: 1rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: var(--primary-glow-lite);
}

.add-to-cart-btn:hover { 
    transform: translateY(-3px) scale(1.01); 
    box-shadow: var(--primary-glow-strong); 
}

.add-to-cart-btn.in-cart { 
    background-image: none;
    background-color: #2e7d32; 
    color: white; 
    border-top: 1px solid var(--border-color); 
    cursor: not-allowed; 
    box-shadow: none;
}
.add-to-cart-btn.unavailable-button { 
    background-image: none;
    background-color: #333; 
    color: #999; 
    cursor: not-allowed; 
    box-shadow: none;
}

.cart-area {
    position: fixed; top: 0; right: 0; width: 100%; max-width: 420px;
    height: 100%; background-color: #1a1a1a;
    z-index: 1500; border-left: 1px solid #333;
    box-shadow: -8px 0 32px rgba(0,0,0,0.6); transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex; flex-direction: column;
}
.cart-area.visible { transform: translateX(0); }
.cart-box { padding: 1.8rem; display: flex; flex-direction: column; height: 100%; }
.close-btn { position: absolute; top: 1rem; right: 1.5rem; background: none; border: none; color: white; font-size: 2rem; cursor: pointer; opacity: 0.7; transition: opacity 0.2s, transform 0.2s; }
.close-btn:hover { opacity: 1; transform: rotate(90deg); }
.cart-box h2 { font-size: 1.8rem; margin-bottom: 1.2rem; text-align: center; color: white; font-weight: 700; }
#cart-items { flex-grow: 1; overflow-y: auto; padding-right: 5px;}
#cart-items::-webkit-scrollbar { width: 8px; }
#cart-items::-webkit-scrollbar-track { background: var(--primary-bg); border-radius: 10px; }
#cart-items::-webkit-scrollbar-thumb { 
    background: var(--accent-green); 
    border-radius: 10px; 
    box-shadow: 0 0 8px var(--accent-green);
}
#cart-items::-webkit-scrollbar-thumb:hover { background: #00ff6a; }

.cart-empty { text-align: center; color: #A0AABA; padding: 2.5rem 0; font-style: italic; }
.cart-item { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 0.8rem 0; border-bottom: 1px dashed #333; 
}
.cart-item-details { display: flex; flex-direction: column; }
.cart-item-name { font-weight: 600; font-size: 1rem; color: #E0E6ED; }
.cart-item-price { font-size: 0.9rem; color: #A0AABA; margin-top: 0.1rem; }
.remove-from-cart-btn {
    background: var(--accent-red); color: white; border: none; border-radius: 50%;
    width: 28px; height: 28px; cursor: pointer; font-weight: 700; font-size: 0.8rem;
    line-height: 28px; transition: background-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}
.remove-from-cart-btn:hover { background-color: #d63031; transform: scale(1.1); }

.cart-total { 
    display: flex; justify-content: space-between; font-size: 1.5rem; font-weight: 700; 
    margin-top: 1.5rem; padding-top: 1.5rem; border-top: 2px solid #333; color: white; 
}
#checkout-button {
    background-image: var(--primary-gradient); 
    color: white; border: none; padding: 1.1rem;
    font-size: 1.1rem; font-weight: 700; cursor: pointer; border-radius: 8px; width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease; margin-top: 1.5rem;
    box-shadow: var(--primary-glow-lite);
    position: relative;
    overflow: hidden;
}

#checkout-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-100%) skewX(-20deg);
    animation: shimmer 2.5s infinite linear;
    animation-delay: 1s;
}

#checkout-button:hover { 
    transform: translateY(-3px) scale(1.01); 
    box-shadow: var(--primary-glow-strong); 
}
#checkout-button:disabled { 
    background-image: none;
    background-color: #333; 
    color: #888; 
    cursor: not-allowed; 
    transform: none; 
    box-shadow: none; 
}

#checkout-button:disabled::before {
    animation: none;
    display: none;
}

#user-bar {
    position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%);
    display: flex; background-color: var(--glass-bg); border: 1px solid #333;
    border-radius: 2rem; box-shadow: 0 8px 30px rgba(0,0,0,0.7);
    z-index: 1001; backdrop-filter: blur(10px);
    animation: slideUp 0.5s 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; opacity: 0;
}
@keyframes slideUp { from { opacity: 0; bottom: 0px; } to { opacity: 1; bottom: 25px; } }

#user-bar button, #user-bar div { 
    display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1.4rem; 
    border: none; color: white; font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: background-color 0.2s ease, transform 0.2s ease;
}
#user-bar button:hover { transform: translateY(-3px); }
#cart-toggle-btn { 
    background-color: transparent; border-top-left-radius: 2rem; border-bottom-left-radius: 2rem; 
    color: var(--accent-green);
}
#cart-toggle-btn:hover { background-color: rgba(0, 242, 96, 0.1); }
#cart-counter { 
    background-color: var(--accent-red); width: 22px; height: 22px; 
    display: flex; justify-content: center; align-items: center; 
    border-radius: 50%; font-size: 0.8rem; font-weight: 700;
}
#user-info { 
    background-color: rgba(0, 242, 96, 0.2); cursor: default; 
    border-left: 1px solid #333; border-right: 1px solid #333; 
    padding: 0.8rem 1.6rem;
}
#user-skin-head { width: 26px; height: 26px; border-radius: 5px; }
#user-nickname { color: white; }
#logout-btn { 
    background-color: transparent; border-top-right-radius: 2rem; border-bottom-right-radius: 2rem;
    color: var(--accent-red);
}
#logout-btn:hover { background-color: rgba(255, 71, 87, 0.15); }

@media (max-width: 768px) {
    .products-grid { grid-template-columns: 1fr; }
    .products-area { padding: 1.5rem; gap: 2.5rem; }
    .store-title { font-size: 2.2rem; }
    .cart-area { max-width: 100%; }
    #user-bar { 
        bottom: 15px; 
        transform: translateX(-50%) scale(0.9); 
        padding: 0;
    }
    #user-bar button, #user-bar div { 
        padding: 0.7rem 1rem; 
        font-size: 0.9rem;
        gap: 0.4rem;
    }
    #user-skin-head { width: 22px; height: 22px; }
    .modal-content { padding: 2rem; }
    .login-logo { width: 80px; }
    .modal-content h2 { font-size: 1.8rem; }
}

#alert-modal-overlay .close-btn {
    position: absolute; top: 1rem; right: 1.5rem;
    background: none; border: none; color: white;
    font-size: 2rem; cursor: pointer; opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    line-height: 1;
}

#alert-modal-overlay .close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}

#alert-modal-ok-btn {
    width: 100%; padding: 0.9rem; font-size: 1.1rem; font-weight: 700;
    background-image: var(--primary-gradient);
    color: white; border: none; border-radius: 8px; cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--primary-glow-lite);
    margin-top: 1rem;
}

#alert-modal-ok-btn:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: var(--primary-glow-strong);
}