/* ============================================
   KPN Universitas Udayana - Mobile App Styles
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #f0f2f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* App Container - Mobile First */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #f0f2f5;
    position: relative;
}

/* ============================================
   Header / App Bar
   ============================================ */
.app-header {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #1976d2 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(13,71,161,0.3);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
}

.header-greeting {
    flex: 1;
}

.header-greeting .greeting-text {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 400;
}

.header-greeting .user-name {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    object-fit: cover;
    cursor: pointer;
    transition: border-color 0.3s;
}

.header-avatar:hover {
    border-color: #fff;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.header-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* ============================================
   Balance Card (Hero)
   ============================================ */
.balance-hero {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #1976d2 100%);
    padding: 0 20px 28px;
    position: relative;
}

.balance-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.balance-label {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.balance-amount {
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
}

.balance-amount .currency {
    font-size: 18px;
    font-weight: 600;
    opacity: 0.8;
    margin-right: 4px;
}

.balance-id {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.balance-id i {
    font-size: 14px;
}

/* ============================================
   Section Titles
   ============================================ */
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    padding: 20px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title .see-all {
    font-size: 13px;
    color: #1a73e8;
    text-decoration: none;
    font-weight: 600;
}

/* ============================================
   Wealth Grid (Kekayaan Anggota)
   ============================================ */
.wealth-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 20px;
}

.wealth-item {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s;
}

.wealth-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.wealth-item .icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.wealth-item .wealth-label {
    font-size: 12px;
    color: #8e8e93;
    font-weight: 500;
    margin-bottom: 4px;
}

.wealth-item .wealth-value {
    font-size: 11px;
    font-weight: 700;
    color: #1a1a2e;
}

/* Icon circle color variants */
.icon-blue { background: #e3f2fd; color: #1565c0; }
.icon-green { background: #e8f5e9; color: #2e7d32; }
.icon-orange { background: #fff3e0; color: #e65100; }
.icon-purple { background: #f3e5f5; color: #7b1fa2; }
.icon-teal { background: #e0f2f1; color: #00695c; }
.icon-red { background: #fce4ec; color: #c62828; }
.icon-amber { background: #fff8e1; color: #f57f17; }
.icon-indigo { background: #e8eaf6; color: #283593; }
.icon-pink { background: #fce4ec; color: #c2185b; }

/* ============================================
   Quick Actions / Service Menu
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 0 20px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 16px 8px;
    border-radius: 16px;
    background: #fff;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.action-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 8px;
}

.action-label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-align: center;
    line-height: 1.3;
}

/* ============================================
   Saldo Cards (Horizontal Scroll)
   ============================================ */
.saldo-scroll {
    display: flex;
    gap: 12px;
    padding: 0 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.saldo-scroll::-webkit-scrollbar {
    display: none;
}

.saldo-card {
    flex: 0 0 auto;
    width: 160px;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    scroll-snap-align: start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.saldo-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-radius: 0 16px 0 60px;
    opacity: 0.08;
}

.saldo-card.card-voucher::after { background: #f57f17; }
.saldo-card.card-tabungan::after { background: #2e7d32; }
.saldo-card.card-takasimura::after { background: #c2185b; }
.saldo-card.card-deposito::after { background: #283593; }
.saldo-card.card-pinjaman::after { background: #c62828; }
.saldo-card.card-kupon::after { background: #b8860b; }

/* Gold icon for kupon undian */
.icon-gold { background: #fff8e1; color: #b8860b; }

/* Kupon count value style */
.saldo-card .saldo-value.kupon-count {
    font-size: 18px;
    color: #b8860b;
}
.saldo-card .saldo-value .kupon-unit {
    font-size: 12px;
    font-weight: 500;
    color: #a0a0a4;
    margin-left: 2px;
}

.saldo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.saldo-card .saldo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 12px;
}

.saldo-card .saldo-label {
    font-size: 12px;
    color: #8e8e93;
    font-weight: 500;
    margin-bottom: 4px;
}

.saldo-card .saldo-sublabel {
    font-size: 10px;
    color: #a0a0a4;
    font-weight: 400;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.saldo-card .saldo-value {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}

.status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-proses {
    background: #fff3e0;
    color: #e65100;
}

.status-badge.status-lunas {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-macet {
    background: #ffebee;
    color: #c62828;
}

/* ============================================
   Transaction List
   ============================================ */
.transaction-list {
    padding: 0 20px;
}

.transaction-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background: #fafafa;
}

.trans-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 14px;
    flex-shrink: 0;
}

.trans-info {
    flex: 1;
    min-width: 0;
}

.trans-info .trans-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trans-info .trans-date {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 2px;
}

.trans-amount {
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.trans-amount.positive { color: #2e7d32; }
.trans-amount.negative { color: #c62828; }

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 12px;
}

.empty-state p {
    color: #8e8e93;
    font-size: 14px;
}

/* ============================================
   Layanan Kupon Undian
   ============================================ */
.kupon-year-section {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 4px;
}

.kupon-empty {
    background: #fff;
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    color: #8e8e93;
}
.kupon-empty i {
    font-size: 36px;
    color: #b8860b;
    opacity: 0.35;
    margin-bottom: 10px;
    display: block;
}
.kupon-empty p {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}
.kupon-empty small {
    font-size: 12px;
    color: #aaa;
}

.kupon-year-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-left: 4px solid #e0e0e0;
    transition: box-shadow 0.2s;
}
.kupon-year-card.kupon-year-active {
    border-left-color: #b8860b;
    background: linear-gradient(135deg, #fffde7, #fff8e1 60%, #fff);
}

.kupon-year-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
}
.kupon-year-num {
    font-size: 20px;
    font-weight: 800;
    color: #333;
    line-height: 1.1;
}
.kupon-badge-aktif {
    margin-top: 4px;
    font-size: 10px;
    font-weight: 700;
    background: #b8860b;
    color: #fff;
    padding: 2px 7px;
    border-radius: 8px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.kupon-year-right {
    flex: 1;
    min-width: 0;
}

.kupon-stat-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.kupon-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.kupon-stat-item i {
    font-size: 14px;
    color: #b8860b;
    flex-shrink: 0;
}
.kupon-stat-val {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}
.kupon-stat-lbl {
    font-size: 11px;
    color: #8e8e93;
}

.kupon-aktif-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #2e7d32;
}
.kupon-aktif-row i {
    font-size: 13px;
}

.kupon-nomor-list {
    background: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.kupon-nomor-title {
    font-size: 13px;
    font-weight: 700;
    color: #5d4037;
    margin-bottom: 10px;
}
.kupon-nomor-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}
.kupon-nomor-item:last-child {
    border-bottom: none;
}
.kupon-nomor-head {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6d6d72;
    margin-bottom: 4px;
}
.kupon-nomor-batch {
    font-weight: 600;
    color: #b8860b;
}
.kupon-nomor-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.kupon-nomor-range {
    font-size: 15px;
    font-weight: 700;
    color: #1a237e;
}
.kupon-nomor-pending {
    font-size: 12px;
    color: #f57c00;
}
.kupon-nomor-belanja {
    font-size: 11px;
    color: #8e8e93;
}

/* Kupon transaction amount style */
.trans-belanja-label {
    font-size: 13px;
    color: #b8860b;
    font-weight: 700;
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.3s;
    min-width: 60px;
}

.nav-item i {
    font-size: 20px;
    color: #adb5bd;
    margin-bottom: 4px;
    transition: color 0.3s;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
    color: #adb5bd;
    transition: color 0.3s;
}

.nav-item.active i,
.nav-item.active span {
    color: #1a73e8;
}

.nav-item:hover i,
.nav-item:hover span {
    color: #1a73e8;
}

/* ============================================
   Pull to Refresh Indicator
   ============================================ */
.refresh-indicator {
    text-align: center;
    padding: 12px;
    color: #8e8e93;
    font-size: 12px;
    display: none;
}

/* ============================================
   Spacing for bottom nav
   ============================================ */
.bottom-spacer {
    height: 80px;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-slide-in {
    animation: slideInRight 0.4s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ============================================
   Responsive - Tablet & Desktop
   ============================================ */
@media (min-width: 481px) {
    body {
        background: #e8eaed;
    }
    .app-container {
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
        border-radius: 0;
    }
}

@media (min-width: 768px) {
    .wealth-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mb-0 { margin-bottom: 0; }
.mt-12 { margin-top: 12px; }
.pb-20 { padding-bottom: 20px; }
/* ============================================
   Saldo Toggle Button
   ============================================ */
.saldo-toggle-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #1a1a2e;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saldo-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1976d2;
}

.saldo-toggle-btn i {
    transition: all 0.3s ease;
}

/* Toggle button in header (balance-label) */
.balance-label .saldo-toggle-btn {
    color: rgba(255,255,255,0.8);
    font-size: 16px;
    padding: 2px 6px;
    flex-shrink: 0;
}

.balance-label .saldo-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* ============================================
   Saldo Hidden State
   ============================================ */
.saldo-hidden .wealth-value,
.saldo-hidden .saldo-value {
    font-size: 0 !important;
    color: transparent !important;
    overflow: hidden;
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.saldo-hidden .wealth-value::after,
.saldo-hidden .saldo-value::after {
    content: "●●●●●●";
    font-size: 16px;
    letter-spacing: 3px;
    color: #999;
    display: inline-block;
}

/* Balance card in header */
.balance-card.saldo-hidden .balance-amount {
    font-size: 0 !important;
    color: transparent !important;
    overflow: hidden;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.balance-card.saldo-hidden .balance-amount::after {
    content: "●●●●●●";
    font-size: 18px;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.5);
    display: inline-block;
}

