/* style.css - LX Light Theme — Apple Liquid Glass × Fintech Premium */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ─── TOKENS ──────────────────────────────────────────────── */
:root {
    /* Palette */
    --accent:           #ccff00;
    --accent-dim:       rgba(204, 255, 0, 0.18);
    --accent-mid:       rgba(204, 255, 0, 0.35);
    --accent-deep:      #a8d600;          /* pressed / shadow tint  */

    --success:          #16a34a;
    --success-bg:       rgba(22, 163, 74, 0.08);
    --danger:           #dc2626;
    --danger-bg:        rgba(220, 38, 38, 0.07);
    --warning:          #d97706;

    /* Surfaces */
    --bg:               #f5f6fa;
    --surface-100:      rgba(255,255,255,0.90);
    --surface-80:       rgba(255,255,255,0.75);
    --surface-60:       rgba(255,255,255,0.60);
    --surface-border:   rgba(0,0,0,0.07);
    --surface-divider:  rgba(0,0,0,0.05);

    /* Text */
    --text-900:         #111111;
    --text-700:         #2b2b2b;
    --text-400:         #6b7280;
    --text-300:         #9ca3af;

    /* Radius */
    --r-xl:  28px;
    --r-lg:  20px;
    --r-md:  14px;
    --r-sm:  10px;
    --r-pill: 999px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --dur: 0.25s;
    --transition: all var(--dur) var(--ease);
}

/* ─── RESET / BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 70% 50% at 20% 10%, rgba(204,255,0,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 85% 90%, rgba(180,240,0,0.07) 0%, transparent 55%);
    background-attachment: fixed;
    color: var(--text-700);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 110px;
    -webkit-font-smoothing: antialiased;
}

/* ─── GLASS CARD ──────────────────────────────────────────── */
.glass-card {
    background: var(--surface-100);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--surface-border);
    border-radius: var(--r-lg);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.04),
        0 8px 24px rgba(0,0,0,0.06);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(0,0,0,0.10);
    box-shadow:
        0 4px 8px rgba(0,0,0,0.05),
        0 14px 36px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* ─── PAGE TRANSITIONS ────────────────────────────────────── */
.page-view {
    display: none;
    animation: lx-fadein 0.35s var(--ease) forwards;
}
.page-view.active { display: block; }

@keyframes lx-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ─── TYPOGRAPHY ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-900);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h2 { font-size: 1.6rem; font-weight: 800; }
h4 { font-size: 1.1rem; }

.text-muted-custom { color: var(--text-400); font-size: 0.875rem; }

/* ─── INPUTS ──────────────────────────────────────────────── */
.glass-input,
.form-control.glass-input,
.form-select.glass-input {
    background: rgba(255,255,255,0.95);
    border: 1.5px solid var(--surface-border);
    color: var(--text-900);
    border-radius: var(--r-md);
    padding: 12px 16px;
    font-weight: 500;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.glass-input:focus,
.form-control.glass-input:focus,
.form-select.glass-input:focus {
    background: #fff;
    border-color: var(--accent-deep);
    box-shadow: 0 0 0 3px var(--accent-mid), 0 1px 3px rgba(0,0,0,0.04);
    color: var(--text-900);
    outline: none;
}

.glass-input::placeholder { color: var(--text-300); }

.glass-input option {
    background: #fff;
    color: var(--text-900);
}

.glass-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-400);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
}

/* ─── BUTTONS ─────────────────────────────────────────────── */
.glass-btn {
    background: rgba(255,255,255,0.85);
    border: 1.5px solid var(--surface-border);
    color: var(--text-700);
    border-radius: var(--r-md);
    padding: 11px 22px;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.glass-btn:hover {
    background: #fff;
    border-color: rgba(0,0,0,0.12);
    color: var(--text-900);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.glass-btn:active { transform: translateY(0); }

/* Primary — accent fill */
.glass-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #111111;
    box-shadow: 0 4px 14px rgba(204,255,0,0.30);
}

.glass-btn-primary:hover {
    background: #d4ff1a;
    border-color: #d4ff1a;
    color: #111111;
    box-shadow: 0 6px 20px rgba(204,255,0,0.40);
}

/* Danger */
.glass-btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
    box-shadow: 0 4px 14px rgba(220,38,38,0.20);
}

.glass-btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
    box-shadow: 0 6px 20px rgba(220,38,38,0.28);
}

/* ─── APP HEADER ──────────────────────────────────────────── */
.app-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(245,246,250,0.80);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--surface-divider);
}

.app-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-900);
    letter-spacing: -0.04em;
}

.app-title i { color: var(--accent-deep); }

.logout-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    background: rgba(255,255,255,0.8);
    border: 1.5px solid var(--surface-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-400);
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.logout-icon-btn:hover {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: rgba(220,38,38,0.20);
}

/* ─── SCREEN HEADER ───────────────────────────────────────── */
.screen-header { margin-bottom: 22px; }
.screen-header h2 { margin-bottom: 2px; }

/* ─── STAT CARDS ──────────────────────────────────────────── */
.stat-card {
    padding: 22px 20px;
    position: relative;
    overflow: hidden;
}

/* Decorative glow blob */
.stat-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -25%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-mid) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card-danger::after {
    background: radial-gradient(circle, rgba(220,38,38,0.12) 0%, transparent 70%);
}

.stat-card-success::after {
    background: radial-gradient(circle, rgba(22,163,74,0.12) 0%, transparent 70%);
}

.stat-value {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-900);
    margin-top: 10px;
    margin-bottom: 4px;
    line-height: 1;
}

/* Override Bootstrap text color utilities inline in HTML */
.stat-value.text-white  { color: var(--text-900) !important; }
.stat-value.text-danger { color: var(--danger) !important; }
.stat-value.text-success{ color: var(--success) !important; }

/* The big outstanding value */
.stat-value.fs-1 { font-size: 2.25rem !important; }

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent-deep);
}

.stat-icon-danger  { background: var(--danger-bg);  color: var(--danger);  }
.stat-icon-success { background: var(--success-bg); color: var(--success); }

/* Active friends count */
#stat-active-friends,
.text-primary { color: var(--accent-deep) !important; }

/* ─── FRIEND LIST ─────────────────────────────────────────── */
.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    margin-bottom: 10px;
    cursor: pointer;
}

.friend-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    flex-shrink: 0;
}

/* ─── BOTTOM NAV ──────────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 70px;
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--surface-border);
    border-radius: var(--r-xl);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 998;
    box-shadow:
        0 4px 16px rgba(0,0,0,0.07),
        0 1px 3px rgba(0,0,0,0.05);
    padding: 0 8px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-400);
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: var(--transition);
    height: 100%;
    flex: 1;
    position: relative;
    border: none;
    background: none;
    outline: none;
    gap: 3px;
}

.bottom-nav-item i {
    font-size: 20px;
    transition: var(--transition);
}

.bottom-nav-item:hover { color: var(--text-700); }

.bottom-nav-item.active {
    color: var(--text-900);
}

/* Accent pill under active icon */
.bottom-nav-item.active i {
    color: var(--accent-deep);
    transform: translateY(-1px);
}

.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 10px;
    width: 20px;
    height: 3px;
    background: var(--accent);
    border-radius: var(--r-pill);
    box-shadow: 0 0 6px var(--accent-mid);
}

/* ─── FAB ─────────────────────────────────────────────────── */
.fab-container {
    position: fixed;
    bottom: 105px;
    right: 20px;
    z-index: 999;
}

.fab-btn {
    width: 58px;
    height: 58px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: #111;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(204,255,0,0.40), 0 2px 6px rgba(0,0,0,0.10);
    cursor: pointer;
    transition: var(--transition);
}

.fab-btn:hover {
    background: #d4ff1a;
    box-shadow: 0 8px 28px rgba(204,255,0,0.50);
}

.fab-btn:active { transform: scale(0.92); }

.fab-menu {
    position: absolute;
    bottom: 72px;
    right: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transform: translateY(16px) scale(0.85);
    pointer-events: none;
    transition: var(--transition);
}

.fab-container.open .fab-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fab-container.open .fab-btn {
    transform: rotate(45deg);
    background: var(--danger);
    box-shadow: 0 6px 24px rgba(220,38,38,0.28);
    color: #fff;
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
    justify-content: flex-end;
}

.fab-menu-label {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    color: var(--text-900);
    padding: 6px 14px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.fab-menu-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.90);
    backdrop-filter: blur(12px);
    border: 1.5px solid var(--surface-border);
    color: var(--text-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: var(--transition);
}

.fab-menu-item:hover .fab-menu-icon {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: scale(1.06);
}

/* ─── MODALS ──────────────────────────────────────────────── */
.modal-content {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid var(--surface-border);
    border-radius: var(--r-xl);
    color: var(--text-900);
    box-shadow:
        0 24px 60px rgba(0,0,0,0.12),
        0 4px 12px rgba(0,0,0,0.06);
}

.modal-header {
    border-bottom: 1px solid var(--surface-divider);
    padding: 20px 24px 14px;
}

.modal-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-900);
}

.modal-footer {
    border-top: 1px solid var(--surface-divider);
    padding: 14px 24px 20px;
}

.modal-backdrop {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background-color: rgba(0,0,0,0.18) !important;
}

.btn-close-custom {
    background: rgba(0,0,0,0.05);
    border: none;
    color: var(--text-400);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    cursor: pointer;
}

.btn-close-custom:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ─── TIMELINE ────────────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--surface-border);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.timeline-dot.lend {
    background: var(--danger);
    border-color: var(--bg);
    box-shadow: 0 0 8px rgba(220,38,38,0.25);
}

.timeline-dot.repayment {
    background: var(--success);
    border-color: var(--bg);
    box-shadow: 0 0 8px rgba(22,163,74,0.25);
}

.timeline-content {
    background: rgba(255,255,255,0.75);
    border: 1px solid var(--surface-divider);
    border-radius: var(--r-md);
    padding: 14px 16px;
}

/* ─── FILTERS / BADGES ────────────────────────────────────── */
.filter-badge {
    background: rgba(255,255,255,0.80);
    border: 1.5px solid var(--surface-border);
    color: var(--text-400);
    padding: 7px 16px;
    border-radius: var(--r-pill);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    margin-right: 8px;
    margin-bottom: 8px;
    display: inline-block;
}

.filter-badge:hover {
    border-color: rgba(0,0,0,0.14);
    color: var(--text-700);
}

.filter-badge.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #111;
    box-shadow: 0 2px 10px var(--accent-mid);
}

/* ─── SEARCH ──────────────────────────────────────────────── */
.search-wrapper { position: relative; }

.search-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-300);
    pointer-events: none;
}

.search-wrapper .glass-input { padding-left: 44px; width: 100%; }

/* ─── TRANSACTION LIST ITEM ───────────────────────────────── */
.transaction-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 8px;
}

/* ─── GLASS TABLE ─────────────────────────────────────────── */
.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.glass-table th {
    background: rgba(0,0,0,0.02);
    color: var(--text-400);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 1px solid var(--surface-divider);
}

.glass-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--surface-divider);
    font-size: 0.9rem;
    color: var(--text-700);
}

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

/* ─── PROFILE CARD ────────────────────────────────────────── */
#profile-balance { color: var(--text-900); }
#profile-total-paid { color: var(--success) !important; }

/* Back button on friend profile */
#screen-friend-profile .btn-link {
    color: var(--text-400) !important;
    font-weight: 600;
    font-size: 0.875rem;
}

#screen-friend-profile .btn-link:hover { color: var(--text-700) !important; }

/* Border in profile card */
#screen-friend-profile .border-top {
    border-color: var(--surface-divider) !important;
}

/* ─── BADGE OVERRIDES (Bootstrap) ────────────────────────── */
.badge.bg-danger { background-color: var(--danger-bg) !important; color: var(--danger) !important; }
.badge.bg-success { background-color: var(--success-bg) !important; color: var(--success) !important; }
.badge.bg-danger.bg-opacity-25 { background-color: var(--danger-bg) !important; color: var(--danger) !important; }

/* ─── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.20); }

/* ─── PRINT ───────────────────────────────────────────────── */
@media print {
    body {
        background: white !important;
        padding-bottom: 0 !important;
    }
    .bottom-nav, .fab-container, .app-header, .glass-btn, .modal { display: none !important; }
    .glass-card {
        border: 1px solid #e5e7eb !important;
        box-shadow: none !important;
        background: white !important;
    }
    .page-view { display: block !important; }
}