@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap');

:root {
    /* ✨ Apple-esque Mini Native Design System */
    --primary: #007AFF;
    --primary-light: #47A1FF;
    --primary-soft: rgba(0, 122, 255, 0.08);
    --secondary: #F2F2F7; /* Apple Grouped Background */
    
    --bg-app: #fbfbfd; 
    --bg-card: #ffffff;
    --bg-surface: #ffffff;
    
    --text-main: #000000;
    --text-muted: #86868b; /* Apple Muted Text */
    
    --success: #34C759;
    --warning: #FF9F0A;
    --danger: #FF3B30;
    
    --radius-full: 999px;
    --radius-xl: 32px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    
    /* Apple Shadows */
    --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.04);
    --shadow-premium: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.03);
    
    --transition: all 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

.cell-mono { 
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; 
    font-variant-numeric: tabular-nums; 
}

/* 📱 NATIVE APP CONTAINER */
.app-container {
    width: 100%;
    max-width: 440px; /* Closer to phone width */
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 24px;
    position: relative;
}

/* 🏦 UNIFIED APPLE HEADER */
.unified-header {
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    color: var(--text-main);
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.logo-white {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--primary);
}

.logo-white span { 
    color: var(--text-main);
    opacity: 0.9;
}

.id-chip {
    background: var(--secondary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.2px;
}

.balance-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.balance-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: -0.1px;
}

.balance-main {
    font-size: 42px;
    font-weight: 800;
    display: flex;
    align-items: baseline;
    gap: 8px;
    letter-spacing: -1.5px;
    color: var(--text-main);
}

.balance-suffix {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 600;
}

/* 💠 APPLE-STYLE CARDS */
.section-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.01);
}

.label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.label-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.2px;
}

/* ⚡️ PILL CHIPS */
.chip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.amount-chip {
    background: var(--secondary);
    border: none;
    padding: 14px 4px;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-main);
}

.amount-chip:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.amount-chip.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}


/* ✍️ CLEAN INPUT */
.premium-input-box {
    position: relative;
    margin-top: 24px;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    opacity: 0.4;
    transition: var(--transition);
}

.styled-input {
    width: 100%;
    background: var(--secondary);
    border: 2.5px solid transparent;
    border-radius: var(--radius-md);
    padding: 18px 20px 18px 52px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    transition: var(--transition);
    text-align: left;
}

.styled-input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.styled-input:focus + .input-icon {
    opacity: 1;
}

.action-btn {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 18px;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 700;
    margin-top: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 20px -5px rgba(0, 122, 255, 0.3);
}

.action-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* 🕒 ACTIVITY FEED */
.history-container {
    padding: 4px 0 0 0;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
}

.activity-item:last-child { border-bottom: none; }

.activity-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.act-title { 
    font-size: 15px; 
    font-weight: 600; 
    color: var(--text-main); 
    letter-spacing: -0.2px;
}

.act-meta { 
    font-size: 12px; 
    color: var(--text-muted); 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.status-pill {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.status-pill.done { background: #eafaf1; color: var(--success); }
.status-pill.pending { background: #fff5e6; color: var(--warning); }

/* 🧾 MODAL ACTION SHEET (APPLE STYLE) */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    align-items: flex-end; 
    justify-content: center;
    transition: opacity 0.3s ease;
}

.overlay.active { display: flex; }

.sheet {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    border-radius: 32px 32px 0 0;
    padding: 32px 24px;
    position: relative;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 92dvh;
    overflow-y: auto;
}

.sheet-handle {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 5px;
    background: #e5e5ea;
    border-radius: var(--radius-full);
}

.qr-display {
    text-align: center;
    margin-bottom: 28px;
}

.qr-wrapper {
    background: #f2f2f7;
    padding: 16px;
    border-radius: 24px;
    display: inline-block;
    margin-top: 20px;
    box-shadow: var(--shadow-inner);
}

#qrCodeImage {
    width: 100%;
    max-width: 240px;
    height: auto;
    display: block;
    border-radius: 12px;
}

.data-card {
    background: var(--secondary);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 24px;
}

.data-row {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
}

.data-row:last-child { border-bottom: none; }

.data-label { 
    font-size: 12px; 
    font-weight: 600; 
    color: var(--text-muted); 
    text-transform: none;
    letter-spacing: -0.1px;
}

.data-value { 
    font-size: 16px; 
    font-weight: 700; 
    color: var(--text-main); 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    word-break: break-all;
    letter-spacing: -0.3px;
}

.mini-copy {
    background: #ffffff;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.mini-copy:active {
    transform: scale(0.9);
    background: var(--secondary);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; }

/* Desktop Fix */
@media (min-width: 768px) {
    .app-container { gap: 24px; padding: 40px 20px; }
    .overlay { align-items: center; padding: 20px; }
    .sheet { border-radius: 32px; max-width: 440px; }
    .data-row { flex-direction: row; justify-content: space-between; align-items: center; }
    .data-value { text-align: right; gap: 12px; }
}


/* 🚀 BOTTOM NAVIGATION & TABS */
.app-layout {
    padding-bottom: 100px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    padding: 12px 24px 34px 24px;
    z-index: 900;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.02);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #999999;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: 64px;
    cursor: pointer;
    background: transparent;
    border: none;
}

.nav-item:active {
    transform: scale(0.92);
}

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

.nav-item svg {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active svg {
    transform: translateY(-2px);
    stroke-width: 2.5px;
    filter: drop-shadow(0 4px 12px var(--primary-soft));
}

.view-section {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: fadeIn 0.3s ease forwards;
}

.view-section.active {
    display: block;
}

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

/* 🍏 iOS THEME EXTENSIONS */
body {
    background-color: #F2F2F7 !important; /* Force iOS Grouped BG */
}

/* iOS Top Nav */
.ios-top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 800;
    border-bottom: 0.5px solid rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.ios-title {
    font-size: 17px;
    font-weight: 600;
    color: #000;
}

/* Bento Hero */
.bento-hero {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    margin-bottom: 24px;
}

.hero-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.hero-amount {
    font-size: 40px;
    font-weight: 800;
    color: #000;
    letter-spacing: -1.5px;
}

/* iOS List Group */
.ios-list {
    background: #FFFFFF;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 24px;
}

.ios-row {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.5px solid rgba(0,0,0,0.05);
}
.ios-row:last-child { border-bottom: none; }

/* Override Chips for iOS look */
.chip-grid {
    gap: 10px;
}
.amount-chip {
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    font-weight: 600;
} 
.amount-chip.active {
    background: var(--primary);
    color: white;
    box-shadow: none;
}

