/* =========================================
   VARIABLES & THEME
   ========================================= */
   :root {
    /* Color Palette - Light Blue & White */
    --primary-color: #0ea5e9; /* Light Blue */
    --primary-hover: #0284c7;
    --primary-light: #e0f2fe;
    
    --bg-main: #f8fafc; /* Very light cool gray/white for background */
    --bg-card: #ffffff;
    
    --text-main: #334155;
    --text-muted: #64748b;
    --text-heading: #0f172a;
    
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    
    /* Typography */
    --font-main: 'Prompt', sans-serif;
    
    /* Shadows & Effects (Premium Soft Shadows) */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 40px -10px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 30px 60px -15px rgba(14, 165, 233, 0.15), 0 15px 25px -5px rgba(14, 165, 233, 0.05);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* =========================================
   RESET & GLOBAL
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Prompt', sans-serif;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.highlight {
    color: var(--primary-color);
}

/* =========================================
   SPA VIEW MANAGEMENT
   ========================================= */
.view {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.view.active {
    display: block;
}

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

/* =========================================
   NAVIGATION BAR
   ========================================= */
.navbar {
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
}

.nav-item {
    font-weight: 500;
    color: var(--text-main);
    position: relative;
    transition: color 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    color: var(--primary-color);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-normal);
}

.nav-item:hover::after, .nav-item.active::after {
    width: 100%;
}

.nav-btn {
    display: inline-block;
    padding: 8px 22px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-btn.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.2);
}

.nav-btn.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 12px -1px rgba(14, 165, 233, 0.35);
    color: white;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 15px -2px rgba(14, 165, 233, 0.4);
    color: white;
}

.btn-logout {
    background-color: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 6px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background-color: var(--danger);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-heading);
    padding: 5px;
}

.nav-mobile-extras {
    display: none;
    align-items: center;
    gap: 12px;
}

.balance-badge-mobile {
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 20px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    position: absolute;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.mobile-menu.show {
    display: flex;
}

.mobile-menu .nav-item, .mobile-menu .nav-btn {
    padding: 15px 0;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.mobile-menu .nav-btn {
    margin-top: 15px;
}

/* =========================================
   HOME: HERO BANNER
   ========================================= */
.hero-banner {
    background: linear-gradient(135deg, #e0f2fe 0%, #ffffff 100%);
    padding: 80px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.btn-large {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
    transition: all var(--transition-normal);
}

.btn-large:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 20px -3px rgba(14, 165, 233, 0.4);
}

/* =========================================
   HOME: PRODUCTS SECTION
   ========================================= */
#products-section {
    padding: 60px 20px;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--text-heading);
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

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

.product-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(226, 232, 240, 0.6);
    position: relative;
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .card-image img {
    transform: scale(1.08);
}

.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--danger);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 1.25rem;
    color: var(--text-heading);
    margin-bottom: 10px;
}

.card-content .details {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.price {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.btn-buy {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-buy:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(14, 165, 233, 0.3);
}

/* =========================================
   LOGIN / REGISTER VIEW
   ========================================= */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px);
    padding: 40px 20px;
    background: radial-gradient(circle at center, #ffffff 0%, var(--bg-main) 100%);
}

.auth-box {
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border-color);
    animation: slideUp var(--transition-normal);
}

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

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 2rem;
    color: var(--text-heading);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-muted);
}

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-heading);
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    background-color: var(--bg-main);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
    background-color: white;
}

.auth-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.forgot-password {
    color: var(--primary-color);
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-full {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
}

.btn-full:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 15px -1px rgba(14, 165, 233, 0.4);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-muted);
}

.register-link {
    color: var(--primary-color);
    font-weight: 600;
}

.register-link:hover {
    text-decoration: underline;
}

/* =========================================
   TOP-UP VIEW
   ========================================= */
.topup-container {
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.topup-header {
    text-align: center;
    margin-bottom: 40px;
}

.topup-header h2 {
    font-size: 2.5rem;
    color: var(--text-heading);
    margin-bottom: 10px;
}

.topup-methods {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.method-card {
    flex: 1;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.method-card i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: block;
    transition: color var(--transition-fast);
}

.method-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
}

.method-card.active {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.method-card.active i, .method-card.active h3 {
    color: var(--primary-color);
}

.topup-content-box {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.topup-form-section {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.topup-form-section.active {
    display: block;
}

.qr-section, .info-section {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px dashed var(--border-color);
}

.qr-code-display {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 20px;
    display: inline-block;
    margin-top: 15px;
    box-shadow: var(--shadow-sm);
}

.qr-header {
    margin-bottom: 15px;
}

.promptpay-logo {
    height: 30px;
    object-fit: contain;
}

.qr-image {
    width: 250px;
    height: 250px;
    display: block;
    margin: 0 auto;
}

.qr-details {
    margin-top: 15px;
    text-align: center;
    font-size: 1.1rem;
}

.qr-details p {
    margin-bottom: 5px;
}

.account-info-box {
    background-color: var(--bg-main);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 15px;
    border: 1px solid var(--border-color);
}

.account-info-box p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.highlight-text {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.btn-copy {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    margin-top: 10px;
}

.btn-copy:hover {
    background-color: var(--primary-light);
}

.upload-section h4 {
    margin-bottom: 15px;
}

.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-main);
    transition: all var(--transition-fast);
    margin-bottom: 20px;
}

.upload-dropzone:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.upload-dropzone i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.slip-preview-container {
    position: relative;
    max-width: 300px;
    margin: 0 auto 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.slip-preview-container img {
    width: 100%;
    display: block;
}

.btn-remove-slip {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color var(--transition-fast);
}

.btn-remove-slip:hover {
    background-color: var(--danger);
}

.btn-submit-topup {
    margin-top: 10px;
}

/* =========================================
   MY ORDERS VIEW
   ========================================= */
#view-orders .container {
    padding: 60px 20px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 2rem;
    color: var(--text-heading);
}

.table-container {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px; /* Ensure horizontal scroll on small devices */
}

.orders-table th, .orders-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.orders-table th {
    background-color: var(--bg-main);
    font-weight: 600;
    color: var(--text-heading);
}

.orders-table tbody tr {
    transition: background-color var(--transition-fast);
}

.orders-table tbody tr:hover {
    background-color: var(--primary-light);
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-cell img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.product-cell span {
    font-weight: 500;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.btn-small {
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-family: inherit;
}

.btn-small.outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-small.outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background-color: #0f172a;
    color: #e2e8f0;
    padding-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-info h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.footer-info p {
    color: #94a3b8;
}

.footer-links h4, .footer-social h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: #94a3b8;
}

.footer-links ul li a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1e293b;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    transition: all var(--transition-fast);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    background-color: #020617;
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-size: 0.9rem;
}

/* =========================================
   RESPONSIVE DESIGN (MOBILE)
   ========================================= */
@media (max-width: 768px) {
    .nav-right {
        display: none;
    }
    
    .nav-mobile-extras {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .topup-methods {
        flex-direction: column;
    }
    
    .table-container {
        border-radius: 0;
        border: none;
        background: transparent;
        box-shadow: none;
    }

    .orders-table, .orders-table thead, .orders-table tbody, .orders-table th, .orders-table td, .orders-table tr {
        display: block;
    }

    .orders-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .orders-table tr {
        background: white;
        margin-bottom: 15px;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-color);
        padding: 10px;
    }

    .orders-table td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
        padding-top: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f8fafc;
    }

    .orders-table td:last-child {
        border-bottom: none;
    }

    .orders-table td:before {
        position: absolute;
        top: 10px;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--text-muted);
        content: attr(data-label);
    }

    /* Mobile User Card Premium Styles */
    .mobile-user-card {
        background: rgba(14, 165, 233, 0.05);
        border: 1px solid rgba(14, 165, 233, 0.1);
        border-radius: 16px;
        padding: 20px;
        margin: 10px 15px 20px;
        text-align: left;
    }

    .mobile-info-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(14, 165, 233, 0.1);
    }

    .m-user {
        font-weight: 600;
        color: var(--text-heading);
        font-size: 1.1rem;
    }

    .m-balance {
        background: var(--primary-color);
        color: white;
        padding: 4px 12px;
        border-radius: 20px;
        font-weight: 700;
        font-size: 0.95rem;
        box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
    }

    .mobile-info-bottom {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .btn-logout-mobile {
        width: 100%;
        background: #f1f5f9;
        color: #64748b;
        border: 1px solid #e2e8f0;
        padding: 10px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 0.9rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.2s;
    }

    .btn-logout-mobile:active {
        background: #fee2e2;
        color: #ef4444;
        border-color: #fecaca;
    }
}
