:root {
    --bg-main: #121212;
    --bg-card: #1e1e1e;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border: #333333;
    --accent: #6366f1;
}

[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --accent: #4f46e5;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Kantumruy Pro', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
}

.main {
    flex: 1;
}

.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-btn, .lang-btn, .icon-btn {
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.logo {
    font-weight: bold;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo span {
    color: var(--accent);
}

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-card);
    box-shadow: 4px 0 15px rgba(0,0,0,0.5);
    transition: 0.3s ease-in-out;
    z-index: 1100;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: 0.2s;
    font-size: 15px;
}

.sidebar-menu li:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
    z-index: 1050;
}

.sidebar-overlay.active {
    visibility: visible;
    opacity: 1;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

.slider-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; 
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 15px;
    cursor: grab;
    user-select: none;
    background-color: var(--bg-card);
}

.slider-track {
    display: flex;
    transition: transform 0.3s ease-out;
    width: 300%;
    height: 100%;
}

.slide {
    width: 33.333%;
    height: 100%;
    flex-shrink: 0;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    pointer-events: none;
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
}

.dot.active {
    background: var(--accent);
    width: 20px;
    border-radius: 4px;
}

.search-box {
    position: relative;
    margin-bottom: 15px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 10px 10px 10px 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    box-sizing: border-box;
    outline: none;
    font-family: 'Kantumruy Pro', sans-serif;
}

.section-title {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.game-img-wrapper {
    width: 100%;
    height: 85px;
    overflow: hidden;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game-info {
    padding: 6px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.game-info h3 {
    margin: 0 0 2px 0;
    font-size: 12px;
}

.game-info p {
    margin: 0;
    font-size: 10px;
    color: var(--text-muted);
}

.account-item-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: 0.2s;
}

.account-card:hover {
    border-color: var(--accent);
}

.account-card-img {
    width: 100%;
    height: 200px;
    position: relative;
    overflow-x: auto;
    display: flex;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.account-card-img::-webkit-scrollbar {
    display: none;
}

.account-img-track {
    display: flex;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}

.account-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: block;
}

.account-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.account-card-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.account-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.account-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-price {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent);
}

.buy-acc-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.faq-section {
    margin-top: 20px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--text-muted);
    font-size: 12px;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 15px;
    background: rgba(0,0,0,0.05);
}

.faq-answer p {
    margin: 10px 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.faq-item.active .faq-answer {
    max-height: 150px;
    padding: 0 15px 12px 15px;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.id-input-wrapper {
    display: flex;
    gap: 8px;
    width: 100%;
}

.id-input-wrapper input {
    flex: 1;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: 'Kantumruy Pro', sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
}

input.input-error, select.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pkg-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.pkg-card.selected {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.pkg-amount {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.pkg-price {
    font-size: 12px;
    color: var(--accent);
    font-weight: bold;
}

.payment-select-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-option-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.payment-option-card.selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.payment-card-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    width: 52px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.khqr-large { background: #e11d48; }

.telegram-badge {
    width: 52px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 16px;
    background: #0088cc;
    color: white;
    flex-shrink: 0;
}

.check-icon {
    display: none;
    color: #10b981;
}

.payment-option-card.selected .check-icon {
    display: block;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--border);
}

.btn-back {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 15px;
    font-family: 'Kantumruy Pro', sans-serif;
}

.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
}

.footer-title {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.footer-payments {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.footer-pay-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.footer-pay-badge.aba { background: #0082c3; }
.footer-pay-badge.khqr { background: #e11d48; }
.footer-pay-badge.acleda { background: #0056b3; }
.footer-pay-badge.wing { background: #e06d00; }

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* KHQR Modal Styling - Adjusted for perfect alignment */
.khqr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.khqr-modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 360px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.khqr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.khqr-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.khqr-modal-header h3 i {
    color: var(--accent);
}

.khqr-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
}

.khqr-modal-body {
    padding: 15px 20px;
    text-align: center;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.khqr-info-box {
    background: var(--bg-main);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-main);
    text-align: left;
    border-left: 4px solid var(--accent);
    width: 100%;
    box-sizing: border-box;
}

.khqr-total-price {
    margin-top: 4px;
    font-weight: bold;
    color: #10b981;
    font-size: 15px;
}

.qr-code-wrapper {
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 0 auto 10px auto;
    width: fit-content;
}

.qr-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.scan-instruction {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 0;
    text-align: center;
}

/* Upload Slip Styles */
.upload-slip-section {
    margin-top: 12px;
    width: 100%;
}

.upload-slip-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: rgba(56, 189, 248, 0.1);
    border: 2px dashed #38bdf8;
    color: #38bdf8;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.upload-slip-label:hover {
    background-color: rgba(56, 189, 248, 0.2);
}

.slip-preview-box {
    position: relative;
    margin-top: 8px;
    width: 100%;
    max-height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
    box-sizing: border-box;
}

.slip-preview-box img {
    max-height: 110px;
    width: auto;
    object-fit: contain;
}

.remove-slip-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.khqr-modal-footer {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
}

.khqr-modal-footer button {
    flex: 1;
    padding: 11px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Kantumruy Pro', sans-serif;
    border: none;
}

.btn-cancel {
    background: var(--border);
    color: var(--text-main);
}

.btn-confirm {
    background: #10b981;
    color: #ffffff;
}
