/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ff6b8b 0%, #ff99ac 100%);
    min-height: 100vh;
    color: #ff6b8b;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

/* Khmer Font Class */
.khmer-font {
    font-family: 'Bokor', cursive, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ff6b8b;
}

/* Header Bar */
.header-bar {
    width: 100%;
    background: linear-gradient(135deg, #ff6b8b 0%, #ff99ac 100%);
    box-shadow: 0 4px 20px rgba(255, 107, 139, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(255, 107, 139, 0.2);
    transition: all 0.3s ease;
}

.logo-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 139, 0.3);
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.site-title {
    font-family: 'Trade Winds', cursive;
    font-size: 2.2em;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b8b 0%, #ff99ac 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 1px;
}

/* Main Wrapper for Side-by-Side Layout */
.main-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    width: 100%;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
    margin-top: 10px;
}

/* Common White Box Style */
.white-box {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(255, 107, 139, 0.2);
    overflow: hidden;
}

/* Left Column: Banners */
.left-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Banner Box Common Styles */
.banner-box {
    width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
}

.banner-section {
    width: 100%;
    height: auto;
}

.banner-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 15px;
    max-width: 100%;
}

/* Specific Banner Styles */
.pich-banner {
    order: 1;
}

.game-banner {
    order: 2;
}

/* Right Column: Function + Package + Payment + Purchase + Footer */
.right-column {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* Function Box */
.function-box {
    padding: 30px;
    width: 100%;
}

/* Package Box */
.package-box {
    padding: 30px;
    width: 100%;
}

/* Payment Box */
.payment-box {
    padding: 25px;
    width: 100%;
}

/* Payment Header */
.payment-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffccd5;
}

.payment-header h3 {
    color: #ff6b8b;
    font-size: 1.5em;
    font-weight: 600;
    font-family: 'Bokor', cursive;
}

/* Payment Methods */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Payment Method */
.payment-method {
    background: #fff5f7;
    border: 2px solid #ffccd5;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    min-height: 90px;
}

.payment-method.active {
    border-color: #ff6b8b;
    background: linear-gradient(135deg, #fff5f7 0%, #ffccd5 100%);
}

/* Payment Method Header */
.payment-method-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

.payment-method-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Payment Icon - Fixed Size */
.payment-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    background: white;
    padding: 10px;
    box-shadow: 0 3px 10px rgba(255, 107, 139, 0.1);
    flex-shrink: 0;
}

.payment-method-details {
    flex: 1;
}

.payment-method-title {
    color: #ff6b8b;
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.payment-method-desc {
    color: #ff6b8b;
    font-size: 0.9em;
    opacity: 0.8;
    margin: 0;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    flex-shrink: 0;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ffccd5;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-input:checked + .toggle-slider {
    background-color: #ff6b8b;
}

.toggle-input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

/* Purchase Box */
.purchase-box {
    padding: 25px;
    width: 100%;
    border: 2px solid #ffccd5;
    background: linear-gradient(135deg, #fff5f7 0%, #fff0f3 100%);
}

/* Purchase Header */
.purchase-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffccd5;
}

.purchase-header h3 {
    color: #ff6b8b;
    font-size: 1.5em;
    font-weight: 600;
    font-family: 'Bokor', cursive;
}

/* Purchase Details */
.purchase-details {
    margin-bottom: 25px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid #ffccd5;
}

.purchase-item, .purchase-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #ffccd5;
}

.purchase-total {
    border-bottom: none;
    font-weight: 700;
}

.item-label, .total-label {
    font-size: 1.1em;
    font-weight: 600;
    color: #ff6b8b;
}

.item-value, .total-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #ff6b8b;
    text-align: right;
}

.total-value {
    font-size: 1.3em;
    color: #ff4757;
}

/* Purchase Actions */
.purchase-actions {
    text-align: center;
}

.buy-now-btn {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ff6b8b 0%, #ff99ac 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Bokor', cursive;
    box-shadow: 0 5px 15px rgba(255, 107, 139, 0.3);
    position: relative;
}

.buy-now-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 139, 0.4);
    background: linear-gradient(135deg, #ff5a7e 0%, #ff8aa3 100%);
}

/* Buy Now Button - Disabled State */
.buy-now-btn:disabled {
    background: linear-gradient(135deg, #ffccd5 0%, #ffdde3 100%);
    color: #ff99ac !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 3px 10px rgba(255, 107, 139, 0.1);
    opacity: 0.7;
}

.buy-now-btn:disabled:hover {
    transform: none;
    box-shadow: 0 3px 10px rgba(255, 107, 139, 0.1);
    background: linear-gradient(135deg, #ffccd5 0%, #ffdde3 100%);
}

.buy-now-btn:disabled::after {
    content: " (ត្រូវជ្រើសរើសកញ្ចប់ និងពិនិត្យឈ្មោះជាមុន)";
    font-size: 0.8em;
    opacity: 0.8;
}

/* Package Header */
.package-header {
    text-align: center;
    margin-bottom: 25px;
}

.package-header h2 {
    color: #ff6b8b;
    font-size: 1.8em;
    font-weight: 600;
    font-family: 'Bokor', cursive;
}

/* Package Tabs */
.package-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #ffccd5;
    padding-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: #fff5f7;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    color: #ff6b8b;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Bokor', cursive;
}

.tab-btn:hover {
    background: #ffccd5;
    color: #ff6b8b;
}

.tab-btn.active {
    background: linear-gradient(135deg, #ff6b8b 0%, #ff99ac 100%);
    color: white;
}

/* Package Grid */
.package-container {
    margin-bottom: 25px;
}

.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.package-grid::-webkit-scrollbar {
    width: 6px;
}

.package-grid::-webkit-scrollbar-track {
    background: #fff5f7;
    border-radius: 10px;
}

.package-grid::-webkit-scrollbar-thumb {
    background: #ff6b8b;
    border-radius: 10px;
}

/* Package Card */
.package-card {
    background: #fff5f7;
    border: 2px solid #ffccd5;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.package-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 107, 139, 0.2);
    border-color: #ff6b8b;
}

.package-card.selected {
    border-color: #ff6b8b;
    background: linear-gradient(135deg, #fff5f7 0%, #ffccd5 100%);
}

/* Package Image */
.package-image-container {
    position: relative;
    margin-bottom: 10px;
}

.package-image {
    width: 100%;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Ticket Badge */
.ticket-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, #ff6b8b 0%, #ff99ac 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Bokor', cursive;
}

/* Package Info */
.package-info {
    padding: 5px 0;
}

.package-name {
    color: #ff6b8b;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.package-price {
    color: #ff6b8b;
    font-size: 1.2em;
    font-weight: 700;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Search Container */
.search-container {
    margin-top: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #ffccd5;
    border-radius: 8px;
    font-size: 1em;
    background: #fff5f7;
    color: #ff6b8b;
    transition: all 0.3s ease;
    font-family: 'Bokor', cursive;
}

.search-input:focus {
    outline: none;
    border-color: #ff6b8b;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 139, 0.1);
    color: #ff6b8b;
}

.search-input::placeholder {
    color: #ff99ac;
    font-style: italic;
    font-family: 'Bokor', cursive;
}

/* Information Section */
.info-section {
    margin-bottom: 25px;
    text-align: center;
}

.info-section h2 {
    color: #ff6b8b;
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: 600;
    font-family: 'Bokor', cursive;
}

/* Form Styles */
.form-section {
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #ff6b8b;
    font-size: 1em;
    font-family: 'Bokor', cursive;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ffccd5;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #fff5f7;
    font-family: 'Bokor', cursive;
    color: #ff6b8b;
}

.input-group input:focus {
    outline: none;
    border-color: #ff6b8b;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 139, 0.1);
    color: #ff6b8b;
}

.input-group input::placeholder {
    color: #ff99ac;
    font-style: italic;
    font-family: 'Bokor', cursive;
}

/* Button Styles */
.check-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff6b8b 0%, #ff99ac 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-family: 'Bokor', cursive;
}

.check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(255, 107, 139, 0.3);
    color: white;
}

.check-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    color: white;
}

/* Result Section Styles */
.result-section {
    margin-top: 25px;
}

.result-box {
    background: #fff5f7;
    border: 2px solid #ffccd5;
    border-radius: 8px;
    padding: 20px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.loading-spinner {
    font-size: 1em;
    color: #ff6b8b;
    font-family: 'Bokor', cursive;
}

#resultContent {
    width: 100%;
    text-align: center;
    font-size: 1em;
    min-height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Bokor', cursive;
    color: #ff6b8b;
}

.success-result {
    color: #ff6b8b;
    font-weight: 500;
    font-size: 1em;
    font-family: 'Bokor', cursive;
}

.error-result {
    color: #ff4757;
    font-weight: 500;
    font-size: 1em;
    font-family: 'Bokor', cursive;
}

/* Footer Container */
.footer-box {
    padding: 25px;
    text-align: center;
    color: #ff6b8b;
    font-weight: 600;
    font-size: 1em;
    font-family: 'Bokor', cursive;
}

/* QR Code Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s ease-out;
    border: 3px solid #ff6b8b;
}

/* Modal Header */
.modal-header {
    background: linear-gradient(135deg, #ff6b8b 0%, #ff99ac 100%);
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-title-container {
    flex: 1;
}

.modal-title {
    color: white;
    font-size: 1.8em;
    font-weight: 700;
    margin: 0;
    text-align: left;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.expiry-time {
    color: white;
    font-size: 1em;
    font-weight: 700;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-close {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    font-size: 2.5em;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 20px;
    flex-shrink: 0;
    font-weight: 300;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(1.1);
    border-color: white;
}

/* QR Content */
.qr-content {
    padding: 50px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #fff5f7 0%, #fff0f3 100%);
}

.qr-container {
    width: 380px;
    height: 380px;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.qr-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 15px;
    padding: 20px;
    border: 3px solid #ffccd5;
    box-shadow: 0 15px 35px rgba(255, 107, 139, 0.2);
}

.qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* QR Logo Overlay */
.qr-logo-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 4px solid white;
    padding: 8px;
    z-index: 10;
}

.qr-logo-circle {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 12px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Loading Spinner for QR */
#qrLoadingSpinner {
    font-size: 1.2em;
    color: #ff6b8b;
    font-weight: 600;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 15px;
    border: 2px solid #ffccd5;
    box-shadow: 0 10px 25px rgba(255, 107, 139, 0.2);
}

/* Animation for QR code appearance */
@keyframes qrAppear {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.qr-image {
    animation: qrAppear 0.5s ease-out;
}

/* Responsive adjustments for QR modal */
@media (max-width: 767px) {
    .modal-content {
        width: 98%;
        max-width: 420px;
        border-radius: 18px;
        border-width: 2px;
    }
    
    .modal-header {
        padding: 20px 25px;
    }
    
    .modal-title {
        font-size: 1.5em;
    }
    
    .expiry-time {
        font-size: 0.9em;
        padding: 4px 10px;
    }
    
    .modal-close {
        width: 45px;
        height: 45px;
        font-size: 2.2em;
        margin-left: 15px;
    }
    
    .qr-content {
        padding: 40px 30px;
    }
    
    .qr-container {
        width: 320px;
        height: 320px;
    }
    
    .qr-image-wrapper {
        padding: 15px;
        border-width: 2px;
    }
    
    .qr-logo-overlay {
        width: 70px;
        height: 70px;
        border-width: 3px;
        padding: 6px;
        border-color: white;
    }
    
    .qr-logo-circle {
        padding: 10px;
    }
    
    #qrLoadingSpinner {
        font-size: 1.1em;
        padding: 15px 25px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;
        max-width: 380px;
        border-radius: 15px;
        margin: 10px;
    }
    
    .modal-header {
        padding: 18px 20px;
    }
    
    .modal-title {
        font-size: 1.3em;
    }
    
    .expiry-time {
        font-size: 0.85em;
        padding: 3px 8px;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 2em;
        margin-left: 10px;
    }
    
    .qr-content {
        padding: 30px 25px;
    }
    
    .qr-container {
        width: 280px;
        height: 280px;
    }
    
    .qr-image-wrapper {
        padding: 12px;
        border-width: 2px;
    }
    
    .qr-logo-overlay {
        width: 60px;
        height: 60px;
        border-width: 3px;
        padding: 5px;
        border-color: white;
    }
    
    .qr-logo-circle {
        padding: 0px;
    }
    
    #qrLoadingSpinner {
        font-size: 1em;
        padding: 12px 20px;
    }
}

/* For very small screens */
@media (max-width: 360px) {
    .qr-container {
        width: 250px;
        height: 250px;
    }
    
    .qr-logo-overlay {
        width: 55px;
        height: 55px;
        border-color: white;
    }
    
    .qr-content {
        padding: 25px 20px;
    }
}

/* For landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .modal-content {
        max-width: 90vh;
        max-height: 90vh;
    }
    
    .qr-container {
        width: 280px;
        height: 280px;
    }
    
    .qr-content {
        padding: 30px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .qr-logo-overlay {
        border-color: white;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .modal-content {
        max-width: 450px;
    }
    
    .qr-container {
        width: 350px;
        height: 350px;
    }
    
    .qr-logo-overlay {
        width: 75px;
        height: 75px;
        border-color: white;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .modal-content {
        max-width: 550px;
        border-radius: 25px;
        border-width: 4px;
    }
    
    .modal-header {
        padding: 30px 35px;
    }
    
    .modal-title {
        font-size: 2em;
    }
    
    .expiry-time {
        font-size: 1.1em;
        padding: 6px 15px;
    }
    
    .modal-close {
        width: 55px;
        height: 55px;
        font-size: 2.8em;
        margin-left: 25px;
    }
    
    .qr-content {
        padding: 60px 50px;
    }
    
    .qr-container {
        width: 400px;
        height: 400px;
    }
    
    .qr-image-wrapper {
        padding: 25px;
        border-width: 4px;
    }
    
    .qr-logo-overlay {
        width: 90px;
        height: 90px;
        border-width: 5px;
        padding: 10px;
        border-color: white;
    }
    
    .qr-logo-circle {
        padding: 15px;
    }
    
    #qrLoadingSpinner {
        font-size: 1.3em;
        padding: 25px 35px;
    }
}

/* Responsive Design: Desktop/Laptop (768px and above) */
@media (min-width: 768px) {
    .main-wrapper {
        flex-direction: row;
        align-items: flex-start;
        padding: 40px;
        gap: 40px;
    }
    
    .left-column {
        flex: 1;
        position: sticky;
        top: 110px;
        align-self: flex-start;
        max-height: calc(95vh - 110px);
        overflow-y: auto;
    }
    
    .right-column {
        flex: 1.5;
    }
    
    .banner-box {
        height: auto;
    }
    
    .pich-banner {
        max-height: 45vh;
    }
    
    .game-banner {
        max-height: 35vh;
    }
    
    .package-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        max-height: 350px;
    }
    
    .logo {
        height: 60px;
    }
    
    .site-title {
        font-size: 2.5em;
    }
    
    .payment-box,
    .purchase-box {
        padding: 30px;
    }
    
    .payment-icon {
        width: 70px;
        height: 70px;
        padding: 12px;
    }
}

/* Responsive Design: Mobile (767px and below) */
@media (max-width: 767px) {
    body {
        padding: 0;
    }
    
    .header-bar {
        padding: 10px 0;
        position: relative;
    }
    
    .header-container {
        padding: 0 15px;
    }
    
    .logo-container {
        padding: 8px 15px;
        gap: 10px;
    }
    
    .logo {
        height: 40px;
    }
    
    .site-title {
        font-size: 1.8em;
    }
    
    .main-wrapper {
        flex-direction: column;
        gap: 20px;
        max-width: 500px;
        margin: 0 auto;
        padding: 20px 15px;
    }
    
    .left-column {
        width: 100%;
        gap: 15px;
    }
    
    .right-column {
        width: 100%;
        gap: 15px;
    }
    
    .banner-box {
        padding: 0;
        height: auto;
    }
    
    .banner-image {
        border-radius: 10px;
        height: auto;
        max-height: none;
    }
    
    .function-box,
    .package-box,
    .payment-box,
    .purchase-box {
        padding: 20px;
    }
    
    .footer-box {
        padding: 20px;
    }
    
    .package-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        max-height: 300px;
    }
    
    .info-section h2,
    .package-header h2,
    .payment-header h3,
    .purchase-header h3 {
        font-size: 1.3em;
    }
    
    .check-btn,
    .buy-now-btn {
        padding: 13px;
        font-size: 1em;
    }
    
    .input-group input {
        padding: 10px;
    }
    
    .result-box {
        padding: 15px;
        min-height: 70px;
    }
    
    .payment-method {
        padding: 15px;
        min-height: 80px;
    }
    
    .payment-icon {
        width: 50px;
        height: 50px;
        padding: 8px;
    }
    
    .payment-method-header {
        min-height: 50px;
    }
    
    .purchase-details {
        padding: 12px;
    }
    
    .item-label,
    .total-label,
    .item-value,
    .total-value {
        font-size: 1em;
    }
    
    /* Responsive adjustments for disabled button text */
    .buy-now-btn:disabled::after {
        content: " (ត្រូវជ្រើសរើសកញ្ចប់ និងពិនិត្យឈ្មោះ)";
        font-size: 0.7em;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .header-bar {
        padding: 8px 0;
    }
    
    .logo-container {
        padding: 6px 12px;
        gap: 8px;
    }
    
    .logo {
        height: 35px;
    }
    
    .site-title {
        font-size: 1.5em;
    }
    
    .main-wrapper {
        gap: 15px;
        padding: 15px 10px;
    }
    
    .left-column {
        gap: 12px;
    }
    
    .right-column {
        gap: 12px;
    }
    
    .function-box,
    .package-box,
    .payment-box,
    .purchase-box {
        padding: 15px;
    }
    
    .footer-box {
        padding: 15px;
    }
    
    .info-section h2,
    .package-header h2,
    .payment-header h3,
    .purchase-header h3 {
        font-size: 1.2em;
    }
    
    .input-group label {
        font-size: 0.9em;
    }
    
    .check-btn,
    .buy-now-btn {
        padding: 12px;
        font-size: 0.95em;
    }
    
    .result-box {
        min-height: 60px;
        padding: 12px;
    }
    
    .success-result, 
    .error-result {
        font-size: 0.9em;
    }
    
    .banner-image {
        border-radius: 8px;
    }
    
    .package-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-height: 250px;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .package-name {
        font-size: 1em;
    }
    
    .package-price {
        font-size: 1.1em;
    }
    
    .payment-method {
        padding: 12px;
        min-height: 70px;
    }
    
    .payment-icon {
        width: 45px;
        height: 45px;
        padding: 6px;
    }
    
    .payment-method-header {
        min-height: 45px;
    }
    
    .payment-method-title {
        font-size: 1em;
    }
    
    .payment-method-desc {
        font-size: 0.8em;
    }
    
    .toggle-switch {
        width: 50px;
        height: 25px;
    }
    
    .toggle-slider:before {
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
    }
    
    .toggle-input:checked + .toggle-slider:before {
        transform: translateX(25px);
    }
    
    .purchase-details {
        padding: 10px;
    }
    
    .item-label,
    .total-label,
    .item-value,
    .total-value {
        font-size: 0.9em;
    }
    
    /* Small mobile adjustments for disabled button text */
    .buy-now-btn:disabled::after {
        content: " (ត្រូវជ្រើសរើស និងពិនិត្យ)";
        font-size: 0.65em;
    }
}

/* Animation for result */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-result, 
.error-result {
    animation: fadeIn 0.3s ease-out;
}

/* Package card selection animation */
@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.package-card.selected {
    animation: selectPulse 0.3s ease;
}

/* Purchase box animation */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.purchase-box {
    animation: slideUp 0.4s ease-out;
}

/* Image loading styling */
.banner-image {
    background: linear-gradient(135deg, #fff5f7 0%, #ffccd5 100%);
}

/* Hover effects for banners */
.banner-image:hover {
    transform: scale(1.01);
    transition: transform 0.3s ease;
}

.banner-image {
    transition: transform 0.3s ease;
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .main-wrapper {
        max-width: 1100px;
        gap: 30px;
    }
    
    .function-box,
    .package-box,
    .payment-box,
    .purchase-box {
        padding: 25px;
    }
    
    .pich-banner {
        max-height: 40vh;
    }
    
    .game-banner {
        max-height: 30vh;
    }
    
    .logo {
        height: 55px;
    }
    
    .site-title {
        font-size: 2.2em;
    }
    
    .payment-icon {
        width: 65px;
        height: 65px;
        padding: 10px;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .main-wrapper {
        max-width: 1500px;
        gap: 50px;
    }
    
    .function-box,
    .package-box,
    .payment-box,
    .purchase-box {
        padding: 40px;
    }
    
    .info-section h2,
    .package-header h2 {
        font-size: 2em;
    }
    
    .payment-header h3,
    .purchase-header h3 {
        font-size: 1.8em;
    }
    
    .input-group label {
        font-size: 1.1em;
    }
    
    .input-group input {
        padding: 15px;
        font-size: 1.1em;
    }
    
    .check-btn,
    .buy-now-btn {
        padding: 18px;
        font-size: 1.2em;
    }
    
    .result-box {
        padding: 25px;
        min-height: 90px;
    }
    
    .success-result, 
    .error-result {
        font-size: 1.1em;
    }
    
    .package-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        max-height: 400px;
        gap: 20px;
    }
    
    .pich-banner {
        max-height: 45vh;
    }
    
    .game-banner {
        max-height: 35vh;
    }
    
    .logo {
        height: 65px;
    }
    
    .site-title {
        font-size: 2.8em;
    }
    
    .payment-method {
        padding: 25px;
        min-height: 100px;
    }
    
    .payment-icon {
        width: 80px;
        height: 80px;
        padding: 12px;
    }
    
    .payment-method-header {
        min-height: 80px;
    }
    
    .purchase-details {
        padding: 20px;
    }
    
    .item-label,
    .total-label,
    .item-value,
    .total-value {
        font-size: 1.2em;
    }
    
    .total-value {
        font-size: 1.5em;
    }
}

/* For landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .banner-image {
        max-height: 40vh;
    }
    
    .main-wrapper {
        max-width: 90vw;
    }
    
    .package-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .header-bar {
        position: sticky;
        top: 0;
    }
    
    .payment-icon {
        width: 55px;
        height: 55px;
    }
}

/* Ensure Bokor font loads properly */
@font-face {
    font-family: 'Bokor Fallback';
    src: local('Arial');
    unicode-range: U+1780-17FF, U+200B-200D, U+25CC;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fff5f7;
}

::-webkit-scrollbar-thumb {
    background: #ff6b8b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff99ac;
}
