:root {
    /* Apple-Inspired Colors */
    --bg-main: #f5f5f7;
    --bg-card: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #424245;
    --text-muted: #86868b;
    --accent-teal: #32ade6;
    /* Apple UI Teal-like */
    --accent-navy: #1d1d1f;
    --border-color: rgba(0, 0, 0, 0.05);

    /* Status Colors */
    --status-green: #34c759;
    --status-yellow: #ffcc00;
    --status-red: #ff3b30;

    /* Shadow & Radii */
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.08);
    --radius-card: 16px;
    --radius-pill: 9999px;

    /* Layout */
    --content-max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.secondary-nav {
    border-top: 1px solid var(--border-color);
}

.nav-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    position: relative;
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
}

.nav-container::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

.nav-tab {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--text-primary);
    font-weight: 600;
}

.nav-indicator {
    position: absolute;
    bottom: 0.375rem;
    left: 0;
    height: calc(100% - 0.75rem);
    background-color: rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-pill);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.logo {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Nav Upload Button */
.nav-upload-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background-color: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-upload-btn:hover,
.nav-upload-btn.dragover {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    background-color: rgba(50, 173, 230, 0.05);
}

.nav-upload-btn.hidden {
    display: none;
}

/* Nav Logout Button */
.nav-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--status-red);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-logout-btn:hover {
    background-color: #fff0f0;
    border-color: rgba(255, 59, 48, 0.3);
}

.nav-logout-btn.hidden {
    display: none;
}

/* Main Layout */
.app-main {
    max-width: var(--content-max-width);
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
}

/* Views */
.view-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.view-section.hidden {
    display: none;
    opacity: 0;
}

/* Cards & Base Component Styles */
.card {
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Risk Assessment View */
.risk-card {
    text-align: center;
    padding: 3rem 2rem;
}

.risk-gauge-container {
    position: relative;
    width: 300px;
    margin: 0 auto 2rem;
}

.risk-gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: -1.5rem;
    /* pull up so it aligns with arc ends */
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    padding: 0 10px;
}

.risk-gauge-score {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1rem;
    line-height: 1;
}

.risk-description p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Category Grid & Progress */
.category-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.category-grid::-webkit-scrollbar {
    width: 6px;
}

.category-grid::-webkit-scrollbar-track {
    background: transparent;
}

.category-grid::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--radius-pill);
}

.cat-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background-color: var(--bg-main);
    padding: 0.75rem 1rem;
    border-radius: 12px;
}

.cat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cat-title {
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cat-amount {
    font-weight: 600;
    font-size: 0.875rem;
}

.cat-progress-bg {
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.cat-progress-fill {
    height: 100%;
    background-color: var(--accent-teal);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Transactions Table */
.filter-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
    background-color: var(--bg-main);
}

.filter-input:focus {
    border-color: var(--accent-teal);
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background-color: var(--bg-main);
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background-color: var(--border-color);
}

.filter-btn.active {
    background-color: var(--text-primary);
    color: var(--bg-card);
    border-color: var(--text-primary);
}

.txn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.txn-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.txn-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.txn-table tbody tr:hover {
    background-color: var(--bg-main);
}

/* Merchant Insights */
.merchant-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.merchant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-main);
    border-radius: 12px;
}

.merchant-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.merchant-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.merchant-badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    background-color: var(--text-primary);
    color: var(--bg-card);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.merchant-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: right;
}

.merchant-amount {
    font-size: 1.125rem;
    font-weight: 700;
}

.sparkline-container {
    width: 60px;
    height: 30px;
}

/* Upload Zone */
.upload-zone {
    background-color: var(--bg-card);
    border: 2px dashed rgba(66, 66, 69, 0.2);
    border-radius: var(--radius-card);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-teal);
    background-color: rgba(50, 173, 230, 0.02);
}

.upload-icon {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.upload-zone:hover .upload-icon {
    color: var(--accent-teal);
}

.upload-zone h2 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.summary-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.summary-card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.summary-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Risk Score Indication */
.risk-indicator {
    display: inline-flex;
    align-items: center;
}

.risk-indicator.safe {
    color: var(--status-green);
}

.risk-indicator.warning {
    color: var(--status-yellow);
}

.risk-indicator.danger {
    color: var(--status-red);
}

/* Dashboard Body (Charts + Feed) */
.dashboard-body {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .dashboard-body {
        grid-template-columns: 1fr;
    }
}

.chart-container h3,
.anomaly-feed h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Anomaly Feed */
.anomaly-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Scrollbar styling for feed */
.anomaly-list::-webkit-scrollbar {
    width: 6px;
}

.anomaly-list::-webkit-scrollbar-track {
    background: transparent;
}

.anomaly-list::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--radius-pill);
}

.anomaly-item {
    background-color: var(--bg-main);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-left: 4px solid var(--status-red);
}

.anomaly-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.anomaly-amount {
    color: var(--text-primary);
}

.anomaly-merchant {
    color: var(--text-primary);
}

.anomaly-reason {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 4rem;
}

/* =========================================================================
   CINEMATIC LANDING PAGE
   ========================================================================= */

#view-landing {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6rem 2rem 4rem;
    background: #fdfdfd;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

#view-landing.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

#dashboard-view {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    position: relative;
    z-index: 1;
}

#dashboard-view.hidden-fade {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

/* Mesh Gradient Background */
.landing-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.dashboard-bg {
    position: fixed;
}

.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    z-index: 0;
}

.blob-1 {
    width: 60vw;
    height: 60vw;
    background: #32ade6;
    top: -20vw;
    left: -10vw;
}

.blob-2 {
    width: 50vw;
    height: 50vw;
    background: #af52de;
    bottom: -10vw;
    right: -10vw;
}

.blob-3 {
    width: 40vw;
    height: 40vw;
    background: #34c759;
    top: 40%;
    left: 30%;
    opacity: 0.2;
}

/* Landing Layout */
.landing-container {
    max-width: 1200px;
    width: 100%;
    z-index: 1;
    position: relative;
}

.landing-top {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 4rem;
    align-items: center;
    margin-bottom: 6rem;
}

@media (max-width: 900px) {
    .landing-top {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-pills,
    .vault-section {
        justify-content: center;
    }
}

/* Hero Section */
.hero-section {
    max-width: 600px;
}

@media (max-width: 900px) {
    .hero-section {
        margin: 0 auto;
    }
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent-blue);
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.hero-highlight {
    background: linear-gradient(135deg, #007aff, #32ade6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 450px;
}

@media (max-width: 900px) {
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
}

.highlight-text {
    font-weight: 700;
    color: var(--accent-purple);
}

.hero-pills {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pill {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot.green {
    background: #34c759;
}

.dot.blue {
    background: #32ade6;
    box-shadow: 0 0 8px rgba(50, 173, 230, 0.5);
}

.dot.purple {
    background: #af52de;
}

/* Vault Card (Glassmorphism) */
.vault-section {
    display: flex;
    justify-content: flex-end;
}

.vault-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
    padding: 3rem 2.5rem;
    border-radius: 28px;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect inside vault card */
.vault-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: skewX(-20deg);
    animation: shimmer 5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    15% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.vault-avatar {
    width: 64px;
    height: 64px;
    background: var(--text-primary);
    color: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.vault-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.vault-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 2.5rem;
}

.vault-form {
    text-align: left;
}

.vault-form .input-group {
    margin-bottom: 1.25rem;
}

.vault-form label {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.vault-form .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.vault-form .input-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
}

.vault-form input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.6);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s;
}

.vault-form input:focus {
    border-color: var(--accent-blue);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(50, 173, 230, 0.1);
}

.btn-unlock {
    width: 100%;
    padding: 1.125rem;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #32ade6 0%, #007aff 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    display: block;
    margin-top: 2rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.25);
}

.btn-unlock:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(0, 122, 255, 0.35);
}

.encryption-notice {
    margin-top: 1.5rem;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-align: center;
}

/* Feature Grid */
.feature-grid-landing {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 8rem;
}

@media (max-width: 800px) {
    .feature-grid-landing {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.icon-blue {
    background: rgba(50, 173, 230, 0.1);
    color: #32ade6;
}

.icon-purple {
    background: rgba(175, 82, 222, 0.1);
    color: #af52de;
}

.icon-green {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.feature-card a {
    font-weight: 600;
    text-decoration: none;
}

/* Workflow Section */
.workflow-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.workflow-section h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.workflow-subtext {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 4rem;
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    text-align: center;
}

@media (max-width: 700px) {
    .workflow-steps {
        grid-template-columns: 1fr;
    }
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--text-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.125rem;
    margin: 0 auto 1.5rem;
}

.step h4 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.step p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
}