@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;700&display=swap');

:root {
    --primary-glow: #a855f7;
    --secondary-glow: #3b82f6;
    --text-color: #e0e0e0;
    --bg-color: #0c0a1a;
    --danger-color: #f87171;
    --danger-color-light: #fca5a5;
    --danger-color-hover: #fecaca;
    --success-color: lightgreen;
    --success-color-light: #a7f3d0;
    --button-secondary-bg: #4a4a6a;
    --button-secondary-border: #6a6a8a;
    --button-secondary-hover-bg: #5a5a7a;
    --button-secondary-disabled-bg: #3a3a5a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Noto Sans SC', sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

#starry-sky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

header {
    width: 100%;
    max-width: 1200px;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    position: relative;
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 0 8px var(--primary-glow);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s, text-shadow 0.3s;
}

nav a:hover {
    color: #fff;
    text-shadow: 0 0 5px var(--secondary-glow);
}

.login-btn {
    border: 1px solid var(--primary-glow);
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.login-btn:hover {
    background-color: rgba(168, 85, 247, 0.1);
    box-shadow: 0 0 8px var(--primary-glow);
}

main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 10;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    color: #b0b0b0;
    text-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
}

.hero-content button {
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.hero-content button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.7);
}

/* Login Page Styles */
.login-container {
    background-color: rgba(12, 10, 26, 0.8);
    padding: 50px;
    border-radius: 15px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.25);
    width: 100%;
    max-width: 440px;
    height: 540px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-container h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #fff;
    text-shadow: 0 0 10px var(--primary-glow);
}

.login-container .input-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-container input {
    width: 100%;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.login-container input::placeholder {
    color: #8a8a8a;
}

.login-container input:focus {
    outline: none;
    border-color: var(--primary-glow);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}

.login-container button {
    width: 100%;
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    color: #fff;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.login-container button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.7);
}

.login-links {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.login-links a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s;
}

.login-links a:hover {
    color: var(--primary-glow);
}

/* Register Page Specifics */
.register-container {
    max-width: 440px;
    height: 540px;
}

.verification-code-group {
    display: flex;
    gap: 10px;
}

.verification-code-group input {
    flex-grow: 1;
}

.verification-code-group button {
    padding: 0 15px;
    background: var(--button-secondary-bg);
    border: 1px solid var(--button-secondary-border);
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.verification-code-group button:hover {
    background-color: var(--button-secondary-hover-bg);
}

.verification-code-group button:disabled {
    background-color: var(--button-secondary-disabled-bg);
    cursor: not-allowed;
}

#message {
    margin-top: 15px;
    min-height: 1.2em;
    font-size: 0.9rem;
}

/* Welcome Page Styles */
.welcome-container {
    /* Inherits styles from .login-container */
    padding: 60px 50px;
}

.welcome-container h2 {
    font-size: 2.5rem;
    color: var(--success-color);
    text-shadow: 0 0 15px var(--success-color);
    margin-bottom: 20px;
}

.welcome-container p {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 10px;
}

.welcome-container .hs-id {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    margin-bottom: 40px;
    letter-spacing: 2px;
}

.to-login-btn {
    display: inline-block;
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.to-login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.7);
}

/* Logged in user styles */
.welcome-user {
    color: var(--success-color-light);
    font-weight: bold;
}

.logout-btn {
    border: 1px solid var(--danger-color-light);
    color: var(--danger-color-light);
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
}

.logout-btn:hover {
    background-color: rgba(252, 165, 165, 0.1);
    box-shadow: 0 0 8px var(--danger-color-light);
    color: var(--danger-color-hover);
}

.unbind-btn {
    padding: 5px 10px; /* More compact padding */
}

.unbind-btn {
    padding: 5px 10px; /* More compact padding */
}

/* New Avatar Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* FINAL Profile Page Styles v2 */
.profile-page-body {
    overflow-y: auto;
    display: block;
}

.final-profile-container {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 40px;
    background-color: rgba(12, 10, 26, 0.85);
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 50px rgba(168, 85, 247, 0.2);
    z-index: 10;
}

.final-profile-header {
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    padding-bottom: 20px;
    margin-bottom: 40px;
    text-align: center;
}

.final-profile-title {
    font-size: 1.8rem;
    color: #ccc;
    font-weight: 400;
    margin: 0;
    display: inline-block;
}

.back-to-home-btn {
    border: 1px solid var(--secondary-glow);
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s, box-shadow 0.3s;
    color: var(--text-color);
    text-decoration: none;
}
.back-to-home-btn.top-left {
    position: absolute;
    top: 60px;
    left: 60px;
}
.back-to-home-btn:hover {
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 8px var(--secondary-glow);
}

.final-profile-content {
    display: flex;
    gap: 40px;
}

.profile-left-column {
    flex: 0 0 320px;
}

.profile-user-card {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(168, 85, 247, 0.2);
}


.profile-card-username {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 0 8px var(--primary-glow);
}

.profile-card-actions {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.profile-card-actions button {
    flex: 1; /* Allow buttons to grow and fill the space */
    min-width: 80px; /* Minimum width for each button */
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer; /* Changed to pointer as they are clickable */
    font-size: 1rem;
    transition: transform 0.2s;
}
.profile-card-actions button:hover {
    transform: translateY(-2px);
}
.profile-card-actions button:first-child {
    background-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}
.profile-card-actions button:last-child {
    background-color: #a855f7;
    color: #fff;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}

.profile-card-actions button:nth-child(3) {
    background-color: #3b82f6; /* Or any other color */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.profile-card-balance {
    display: flex;
    justify-content: space-around;
    background-color: rgba(168, 85, 247, 0.4);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.profile-card-details {
    list-style: none;
    text-align: left;
    font-size: 0.95rem;
    color: #ccc;
}
.profile-card-details li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.profile-card-details li:last-child {
    border-bottom: none;
}

.profile-right-column {
    flex-grow: 1;
}

.form-group {
    margin-bottom: 25px;
}
.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #ccc;
    font-size: 1rem;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-glow);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}
.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.upload-form-final {
    display: flex;
    align-items: center;
    gap: 15px;
}
.file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}
.file-label {
    background-color: var(--button-secondary-bg);
    border: 1px solid var(--button-secondary-border);
    color: #fff;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.file-label:hover {
    background-color: var(--button-secondary-hover-bg);
}
.file-name {
    color: #ccc;
    font-style: italic;
    font-size: 0.9rem;
}
.upload-form-final button {
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}
.upload-form-final button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Store Page Styles (Optimized) */
.profile-header {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.profile-username {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.store-container {
    width: 100%;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 40px;
    padding-bottom: 120px; /* Space for the footer */
}

.store-main-content {
    display: flex;
    gap: 30px;
}

.store-left-column {
    flex: 0 0 280px;
}

.store-right-column {
    flex-grow: 1;
}

.store-section {
    background-color: rgba(12, 10, 26, 0.85);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.1);
}

.store-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.store-header input {
    flex-grow: 1;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
}

.store-header button {
    background: var(--secondary-glow);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.store-header button:hover {
    background: #4b92ff;
    box-shadow: 0 0 15px var(--secondary-glow);
}

.section-title {
    font-size: 1.4rem;
    color: #ddd;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    padding-bottom: 10px;
    font-weight: 400;
}

.category-list {
    list-style: none;
}

.category-list-item {
    padding: 12px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    margin-bottom: 8px;
    color: #ccc;
}

.category-list-item:hover {
    background-color: rgba(59, 130, 246, 0.2);
}

.category-list-item.active {
    background-color: rgba(59, 130, 246, 0.4);
    color: #fff;
    font-weight: bold;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.product-item {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid rgba(168, 85, 247, 0.2);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.2);
}

.product-item.active {
    border-color: var(--secondary-glow);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    transform: scale(1.05);
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    min-height: 48px; /* for 2 lines */
}

.product-price {
    color: var(--danger-color);
    font-size: 1.3rem;
    margin-bottom: 5px;
    font-weight: bold;
}

.product-stock {
    font-size: 0.9rem;
    color: #aaa;
}

.product-details-section {
    text-align: left;
}

.product-details-image {
    width: 100%;
    max-width: 300px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid var(--secondary-glow);
}

.product-details-name {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #fff;
}

.product-details-price {
    font-size: 1.8rem;
    color: var(--danger-color);
    margin-bottom: 15px;
}

.product-details-description {
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.6;
}

.purchase-form label {
    display: block;
    margin-bottom: 10px;
    color: #ccc;
}

.purchase-form input[type="text"] {
    width: 100%;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 20px;
}

.checkbox-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.store-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(12, 10, 26, 0.95);
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 30px;
    border-top: 1px solid rgba(168, 85, 247, 0.3);
    z-index: 100;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-selector input {
    width: 60px;
    text-align: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--button-secondary-bg);
    color: #fff;
    padding: 8px;
    border-radius: 5px;
    font-size: 1rem;
}

.quantity-selector button {
    width: 35px;
    height: 35px;
    background: var(--button-secondary-bg);
    border: 1px solid var(--button-secondary-border);
    color: #fff;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.quantity-selector button:hover {
    background-color: var(--button-secondary-hover-bg);
}

.total-price-container {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.total-price-label {
    font-size: 1rem;
    color: #ccc;
}

.total-price {
    font-size: 2rem;
    color: var(--danger-color);
    font-weight: bold;
}

.checkout-btn {
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.checkout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

.checkout-btn:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Enhanced Modal Styles v2 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(12, 10, 26, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fade-in 0.3s ease-out;
}

.modal-content {
    background-color: rgba(12, 10, 26, 0.8);
    margin: 15% auto;
    padding: 50px;
    border-radius: 15px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.25);
    width: 100%;
    max-width: 440px;
    position: relative;
    animation: slide-up 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-up {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #fff;
    text-shadow: 0 0 10px var(--primary-glow);
    border-bottom: none;
    padding-bottom: 0;
    text-align: center;
}

.modal-content .input-group,
.modal-content input,
.modal-content button {
    width: 100%;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 5px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: 'Noto Sans SC', sans-serif;
}

.modal-content input::placeholder,
.modal-content textarea::placeholder {
    color: #8a8a8a;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--primary-glow);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}

.modal-content textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-content button {
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    color: #fff;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    margin-top: 10px; /* Add some space above the button */
}

.modal-content button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.7);
}

.close-btn {
    color: #888;
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: #fff;
    transform: rotate(90deg);
    text-decoration: none;
}

/* HS ID Modal Styles */
.modal-content.wide {
    max-width: 800px;
}

.hs-id-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.hs-id-item {
    background-color: var(--button-secondary-bg);
    border: 1px solid var(--button-secondary-border);
    color: #fff;
    padding: 15px 10px;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.hs-id-item:hover {
    background-color: var(--button-secondary-hover-bg);
    transform: translateY(-2px);
}

.hs-id-item.active {
    background-color: var(--secondary-glow);
    box-shadow: 0 0 15px var(--secondary-glow);
    transform: scale(1.05);
}

.hs-id-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(168, 85, 247, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .final-profile-content {
        flex-direction: column;
    }

    .profile-left-column {
        flex: 1;
    }

    .store-main-content {
        flex-direction: column;
    }

    .store-left-column {
        flex: 1;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .store-footer {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .login-container {
        padding: 30px;
        height: auto;
    }
}

/* Red Envelope Styles */
#red-envelope-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    cursor: pointer;
}

.red-envelope {
    width: 64px;
    height: 64px;
    padding: 12px;
    background-color: #e53935;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.6);
    animation: fall-down 1.5s ease-out forwards, shake 1s 1.5s infinite;
    color: #fdd835; /* This will color the embedded SVG icon */
}

.red-envelope svg {
    width: 100%;
    height: 100%;
}

@keyframes fall-down {
    0% {
        transform: translateY(-100vh);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

/* Announcement Modal Styles */
.modal-content.announcement {
    border-color: #f59e0b; /* Gold/Amber color */
    box-shadow: 0 0 60px rgba(245, 158, 11, 0.4), 0 0 25px rgba(239, 68, 68, 0.2);
    background: linear-gradient(145deg, #2d1a0e, #1a100a);
}

.modal-content.announcement h2 {
    color: #f59e0b;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.7);
    border-bottom-color: rgba(245, 158, 11, 0.3);
}

.modal-content.announcement h2 .fa-bullhorn {
    margin-right: 10px;
}

#announcement-content-display {
    margin-top: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #e0e0e0;
    white-space: pre-wrap; /* Respects newlines and spaces */
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 10px; /* For scrollbar */
}

/* My Keys Page Specific Styles */
.license-keys-section-full-page {
    margin-top: 20px;
}

.table-container {
    overflow-x: auto; /* Add horizontal scroll for smaller screens */
}

#license-keys-table {
    width: 100%;
    border-collapse: collapse;
    color: #ccc;
    white-space: nowrap; /* Prevent text wrapping */
}

#license-keys-table th,
#license-keys-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#license-keys-table th {
    background-color: transparent;
    font-weight: bold;
    color: #fff;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#license-keys-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

#license-keys-table td {
    font-size: 0.95rem;
}

#license-keys-table .license-key-cell {
    font-family: 'Courier New', Courier, monospace;
    cursor: pointer;
    transition: color 0.3s;
}

#license-keys-table .license-key-cell:hover {
    color: var(--secondary-glow);
}

.status-activated {
    color: var(--danger-color);
    font-weight: bold;
}

.status-not-activated {
    color: var(--success-color);
    font-weight: bold;
}

/* Forgot Password Modal Styles */
.modal .modal-content p {
    color: #ccc;
    margin-bottom: 20px;
    text-align: center;
}

.modal .close-button {
    color: #888;
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    line-height: 1;
}

.modal .close-button:hover,
.modal .close-button:focus {
    color: #fff;
    transform: rotate(90deg);
    text-decoration: none;
}

#forgot-password-message {
    margin-top: 15px;
    min-height: 1.2em;
    font-size: 0.9rem;
}

/* Confirmation Modal Button Styles */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.modal-actions button {
    padding: 10px 25px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-actions button:hover {
    transform: translateY(-2px);
}

.btn-confirm {
    background-color: var(--danger-color);
    color: #fff;
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.5);
}

.btn-confirm:hover {
    box-shadow: 0 0 25px rgba(248, 113, 113, 0.7);
}

.btn-cancel {
    background-color: var(--button-secondary-bg);
    color: #fff;
    border: 1px solid var(--button-secondary-border);
}

.btn-cancel:hover {
    background-color: var(--button-secondary-hover-bg);
}

/* Contact Info Styles */
.contact-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(168, 85, 247, 0.2);
    text-align: center;
}

.contact-info h4 {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 15px;
    text-shadow: 0 0 8px var(--primary-glow);
}

.contact-info p {
    font-size: 1rem;
    color: #ccc;
    margin-bottom: 10px;
}

.contact-info a {
    color: var(--secondary-glow);
    text-decoration: none;
    transition: color 0.3s, text-shadow 0.3s;
}

.contact-info a:hover {
    color: #fff;
    text-shadow: 0 0 5px var(--secondary-glow);
}

/* Profile Avatar Styles */
.profile-card-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(168, 85, 247, 0.5);
    margin-bottom: 20px;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

#upload-avatar-form {
    margin-bottom: 15px;
}

/* Membership Level Styles */
.membership-level {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.level-初芽会员 { background-color: #84cc16; color: #1a2e05; }
.level-漫游会员 { background-color: #22d3ee; color: #062a41; }
.level-拾光会员 { background-color: #f97316; color: #451a03; }
.level-回声会员 { background-color: #ec4899; color: #581c37; }
.level-星轨会员 { background: linear-gradient(45deg, #6366f1, #a855f7); color: #e0e7ff; }
.level-叠浪会员 { background: linear-gradient(45deg, #22d3ee, #0ea5e9); color: #e0f2fe; }
.level-棱镜会员 { background: linear-gradient(45deg, #f43f5e, #ec4899, #d946ef); color: #fdf2f8; }
.level-织网会员 { background: linear-gradient(45deg, #f59e0b, #f97316, #ef4444); color: #fffbeb; }
.level-锚点会员 { background-color: #475569; color: #e2e8f0; }
.level-航标会员 { background-color: #eab308; color: #422006; }
.level-密钥会员 { background: linear-gradient(45deg, #a855f7, #d946ef); color: #f5d0fe; text-shadow: 0 0 5px #fff; }
.level-原力会员 { background: linear-gradient(45deg, #fde047, #f59e0b, #eab308); color: #422006; text-shadow: 0 0 8px #fff; border: 1px solid #fff; }

/* Added Membership Card Styles */
.membership-level-card {
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.membership-level-card .level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1rem;
}

.membership-level-card .current-level {
    font-weight: bold;
    color: #fff;
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    padding: 4px 10px;
    border-radius: 5px;
}

.membership-level-card .next-level-progress {
    color: #ccc;
}

.membership-level-card .progress-bar-container {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.membership-level-card .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.membership-level-card .points-needed {
    font-size: 0.85rem;
    color: #aaa;
    text-align: center;
}
