/* style.css (Final Polished Version) */
:root {
    --bg-color: #0f172a;
    --primary-accent: #00f5ff;
    --secondary-accent: #e94560;
    --highlight-yellow: #feca57;
    --text-color: #e0e0e0;
    --text-muted: #cbd5e1;
    --font-primary: 'Orbitron', sans-serif;
    --font-secondary: 'Poppins', sans-serif;
    --glass-bg: rgba(31, 41, 55, 0.35);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);
    --glass-blur: blur(12px);
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    color: var(--text-color);
    background: linear-gradient(-45deg, #0f172a, #1e3a8a, #4c1d95, #be185d);
    background-size: 400% 400%;
    animation: gradient-animation 25s ease infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
}

.form-container,
.history-container,
.modal-content,
.dashboard-card,
.marquee-container,
header {
    background: var(--glass-bg);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    padding: 20px;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 20px;
    gap: 15px;
}

.site-logo {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

h2 {
    font-family: var(--font-primary);
    text-align: center;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0;
    margin-bottom: 30px;
    text-shadow: 0 0 8px var(--primary-accent), 0 0 12px rgba(0, 245, 255, 0.5);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    white-space: nowrap;
}

.welcome-text {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.auth-buttons a,
.back-button {
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--glass-bg);
    border: var(--glass-border);
    white-space: nowrap;
}

.auth-buttons a:hover,
.back-button:hover {
    background: rgba(0, 245, 255, 0.2);
    border: 1px solid var(--primary-accent);
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.3);
    color: #fff;
}

.link-yellow {
    color: var(--highlight-yellow) !important;
    font-weight: bold;
    font-size: 14px;
    text-decoration: underline !important;
    background: none !important;
    border: none !important;
    padding: 10px !important;
    margin-left: 0;
}

.link-yellow:hover {
    color: #fff !important;
}

.dashboard-full-button {
    display: block;
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--primary-accent);
    color: #fff;
    text-align: center;
    padding: 15px;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.3);
}

.dashboard-full-button:hover {
    background: rgba(0, 245, 255, 0.2);
    box-shadow: 0 0 25px rgba(0, 245, 255, 0.7);
    transform: translateY(-2px) scale(1.02);
}

button[type="submit"],
.modal-ok-button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--secondary-accent), #8a2be2);
    color: white;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    margin-top: 20px;
}

button[type="submit"]:hover:not(:disabled),
.modal-ok-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.5);
}

.splide {
    margin-bottom: 30px;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.splide__slide {
    aspect-ratio: 16 / 9;
}

.splide__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.marquee-container {
    margin-bottom: 30px;
    padding: 15px 0;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-text {
    display: inline-block;
    color: var(--text-muted);
    animation: marquee 20s linear infinite;
    padding-left: 100%;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.game-card,
.package-card,
.payment-card,
.history-item,
.redeem-item {
    background: var(--glass-bg);
    border: 2px solid transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.game-card:hover,
.package-card:hover,
.payment-card:hover,
.history-item:hover,
.redeem-item:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 245, 255, 0.5);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.package-card.selected,
.payment-card.selected {
    border-color: var(--primary-accent);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.5);
    transform: scale(1.05);
}

.game-card {
    text-decoration: none;
    color: var(--text-color);
    padding: 20px;
    display: flex;
    align-items: center;
}

.game-card img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    margin-right: 15px;
}

.game-card span {
    font-family: var(--font-primary);
    font-weight: 600;
}

.package-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.package-card {
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.package-card input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.package-card-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.package-card-content {
    padding: 8px 10px;
}

.package-card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.package-card-bonus {
    font-size: 12px;
    color: var(--text-muted);
    min-height: 16px;
}

.package-card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-accent);
    margin-top: 5px;
}

.package-tag {
    position: absolute;
    top: 8px;
    left: -1px;
    background-color: var(--secondary-accent);
    color: white;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 0 4px 4px 0;
    text-transform: uppercase;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
}

.history-item.item-clickable {
    cursor: pointer;
}

.history-item .item-data,
#recent-accounts-list .history-item .item-data {
    color: var(--text-color);
}

.history-item .order-date,
#recent-accounts-list .history-item .order-date {
    color: var(--text-muted);
}

label {
    display: block;
    margin: 15px 0 8px;
    color: var(--text-muted);
    font-weight: 600;
}

.see-recent-btn {
    color: var(--highlight-yellow);
    text-decoration: underline;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
    margin-left: 8px;
    font-weight: 400;
}

.see-recent-btn:hover {
    color: var(--primary-accent);
}

input,
select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-sizing: border-box;
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    animation: slide-down 0.4s ease-out;
    max-width: 450px;
    width: 90%;
    margin-bottom: 5vh;
}

@keyframes slide-down {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 35px;
    font-weight: bold;
    position: absolute;
    top: 5px;
    right: 15px;
}

#package-search-box {
    font-family: var(--font-secondary);
}

.payment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.payment-card {
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.payment-card img {
    height: 40px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.payment-card span {
    margin-top: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-left: 10px;
}

.status-pending {
    background-color: #f0932b;
}

.status-approved {
    background-color: #2ed573;
}

.status-rejected {
    background-color: #ff4757;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

#recent-accounts-list .history-item .item-data {
    color: var(--highlight-yellow);
}

.dashboard-card {
    border: 1px solid var(--border-color);
}

.card-title {
    font-family: var(--font-primary);
    color: var(--primary-accent);
    font-size: 18px;
    margin-bottom: 10px;
}

.points-display {
    font-family: var(--font-primary);
    font-size: 32px;
    font-weight: 700;
    color: var(--highlight-yellow);
    text-align: center;
}

.referral-link-box {
    display: flex;
    margin-top: 15px;
}

.referral-link-box input {
    flex-grow: 1;
    background-color: #1a1a2e;
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}

.referral-link-box button {
    border-radius: 8px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border: 1px solid var(--border-color);
    background-color: var(--primary-accent);
    color: var(--bg-color);
    font-family: var(--font-primary);
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 0 20px;
}

.redeem-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid var(--secondary-accent);
}

.redeem-item-name {
    font-weight: 600;
}

.redeem-item-cost {
    font-size: 14px;
    color: var(--text-muted);
}

.redeem-btn {
    border: none;
    border-radius: 6px;
    background-color: var(--highlight-yellow);
    color: var(--bg-color);
    font-family: var(--font-primary);
    font-weight: bold;
    cursor: pointer;
    padding: 8px 15px;
    transition: all 0.2s;
}

.redeem-btn:hover {
    background-color: #fff;
    box-shadow: 0 0 10px var(--highlight-yellow);
}

.redeem-btn:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

td .action-btn {
    margin-bottom: 5px;
}

#order-modal-title {
    color: var(--highlight-yellow);
}

#selected-package-info {
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

#selected-package-name {
    font-weight: bold;
    color: var(--text-color);
    display: block;
}

#selected-package-price {
    color: var(--primary-accent);
    font-family: var(--font-primary);
}

.payment-info {
    margin-top: 15px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
    margin-top: 0;
}

.cancel-btn {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    background-image: none;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-color);
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/* --- Account Name Display Styles --- */
#account-name-display {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
}

#account-name-display .checking {
    color: var(--text-muted);
}

#account-name-display .success {
    color: var(--highlight-yellow);
}

#account-name-display .error {
    color: var(--secondary-accent);
}
/* --- Style for account name in recent list --- */
#recent-accounts-list .account-name-result {
    display: block;
    color: var(--highlight-yellow);
    font-size: 13px;
    font-weight: bold;
    margin-top: 4px;
}

#recent-accounts-list .account-name-result.checking {
    color: var(--text-muted);
    font-style: italic;
}

#recent-accounts-list .account-name-result.error {
    color: var(--secondary-accent);
    font-style: italic;
}