/* Tokopedia-Style PPOB App - Mobile First Design */

:root {
    --primary-color: #42b549;
    --primary-dark: #2d8a38;
    --secondary-color: #ff6b35;
    --text-dark: #31353b;
    --text-gray: #6d7588;
    --bg-gray: #f5f5f5;
    --border-color: #e5e7e9;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 70px; /* Space for bottom nav */
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Top Header */
.top-header {
    background: var(--white);
    padding: 12px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

.icon-btn:hover {
    background: var(--bg-gray);
}

.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--secondary-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
    color: white;
    box-shadow: var(--shadow);
}

.balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.balance-amount {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 16px;
}

.balance-actions {
    display: flex;
    gap: 12px;
}

.btn-balance {
    flex: 1;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-balance:hover {
    background: rgba(255,255,255,0.3);
}

/* Shortcut Menu */
.shortcut-menu {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: var(--shadow);
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.shortcut-item {
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.3s;
}

.shortcut-item:hover {
    transform: translateY(-4px);
}

.shortcut-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 8px;
    box-shadow: var(--shadow);
}

.shortcut-label {
    font-size: 12px;
    font-weight: 500;
}

/* Banner Promo */
.banner-section {
    margin: 16px 0;
}

.banner-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.banner-scroll::-webkit-scrollbar {
    display: none;
}

.banner-item {
    flex: 0 0 90%;
    scroll-snap-align: start;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.banner-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

/* Section Title */
.section-title {
    font-size: 18px;
    font-weight: bold;
    margin: 24px 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.see-all {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-dark);
}

.product-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg-gray);
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.product-stock {
    font-size: 12px;
    color: var(--text-gray);
}

/* Digital Product List */
.digital-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.digital-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s;
}

.digital-item:last-child {
    border-bottom: none;
}

.digital-item:hover {
    background: var(--bg-gray);
}

.digital-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 16px;
}

.digital-info {
    flex: 1;
}

.digital-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.digital-desc {
    font-size: 12px;
    color: var(--text-gray);
}

.digital-price {
    font-weight: bold;
    color: var(--primary-color);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 100;
}

.bottom-nav-content {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
}

.nav-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: var(--text-gray);
    padding: 8px;
    transition: color 0.3s;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Transaction List */
.transaction-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.transaction-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.transaction-title {
    font-weight: 600;
    font-size: 14px;
}

.transaction-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.transaction-date {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 4px;
}

.transaction-amount {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Profile Section */
.profile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 24px 16px;
    color: white;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 12px;
    box-shadow: var(--shadow);
}

.profile-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 4px;
}

.profile-email {
    font-size: 14px;
    opacity: 0.9;
}

.profile-menu {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 16px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.3s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: var(--bg-gray);
}

.menu-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-gray);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 16px;
}

.menu-text {
    flex: 1;
    font-weight: 500;
}

.menu-arrow {
    color: var(--text-gray);
}

/* Responsive - Tablet & Desktop */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .shortcut-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
    
    .banner-item {
        flex: 0 0 45%;
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .banner-item {
        flex: 0 0 30%;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-subtext {
    font-size: 14px;
}
