/* Reset dasar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

/* Container utama */
.container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    min-height: 85vh;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Saldo utama */
.main-balance {
    text-align: center;
    margin: 40px 0;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
}

.main-balance h3 {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 8px;
}

.main-balance h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Metrics */
.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
}

.metric {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
}

.metric .label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.metric .value {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Tombol aksi */
.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 48px;
}

.btn {
    display: block;
    padding: 18px;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-topup {
    background: #10b981;
    color: white;
}

.btn-withdraw {
    background: #ef4444;
    color: white;
}

.btn-logout {
    background: #f3f4f6;
    color: #666;
    margin-top: 16px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.btn-submit {
    width: 100%;
    background: #667eea;
    color: white;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
}

/* Login page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.login-title {
    text-align: center;
    margin-bottom: 32px;
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

/* Error message */
.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* History Page Styles */
.history-container {
    margin-top: 20px;
}

.transaction-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 4px solid;
}

.transaction-topup {
    border-left-color: #10b981;
}

.transaction-withdraw {
    border-left-color: #ef4444;
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.transaction-type {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.type-topup {
    background: #d1fae5;
    color: #065f46;
}

.type-withdraw {
    background: #fee2e2;
    color: #991b1b;
}

.transaction-date {
    font-size: 12px;
    color: #666;
    text-align: right;
}

.transaction-date small {
    font-size: 11px;
    color: #999;
    display: block;
    margin-top: 2px;
}

.transaction-amount {
    font-size: 18px;
    font-weight: 700;
    margin: 8px 0;
}

.transaction-notes {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state img {
    width: 80px;
    opacity: 0.5;
    margin-bottom: 16px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-label {
    font-size: 14px;
    opacity: 0.9;
}

.summary-value {
    font-size: 16px;
    font-weight: 600;
}

.back-button {
    display: inline-block;
    margin-bottom: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-button:hover {
    text-decoration: underline;
}

/* Info box */
.info-box {
    background: #f0f9ff;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid #3b82f6;
}

.info-box .label {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.info-box .value {
    font-size: 20px;
    font-weight: 600;
    color: #1e40af;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-button {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.tab-button.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tab-count {
    background: #e5e7eb;
    color: #666;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
}

.tab-button.active .tab-count {
    background: #667eea;
    color: white;
}

/* Sort Select */
select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

/* Responsif untuk mobile kecil */
@media (max-width: 360px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 16px;
    }
    
    .main-balance h1 {
        font-size: 32px;
    }
    
    .metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .transaction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .transaction-type {
        align-self: flex-start;
    }
    
    .transaction-date {
        text-align: left;
        align-self: flex-start;
    }
}

/* Responsif Tab */
@media (max-width: 400px) {
    .tab-button {
        font-size: 13px;
        padding: 10px 6px;
    }
    
    .tab-count {
        font-size: 11px;
        padding: 1px 6px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.transaction-item {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}