@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Neutrals - Dark Surfaces */
    --c-ink-900: #0b0b0c;
    --c-navy-900: #0d1420;
    --c-navy-800: #0f1a2e;
    --c-navy-700: #1a2440;
    --c-ink-500: #9a9a9f;
    --c-ink-200: #ebebeb;

    /* Spark - Energy, CTAs */
    --c-spark: #f16722;
    --c-spark-hover: #d05014;
    --c-spark-soft: #ff8447;
    --c-spark-tint: rgba(241,103,34,0.16);

    /* Trust - Verification, Premium */
    --c-trust: #51adef;
    --c-trust-hover: #3697db;
    --c-trust-soft: #6bbff9;
    --c-trust-deep: #2b7fc4;

    /* Semantic */
    --c-success: #4ec38a;
    --c-warning: #f5b95a;
    --c-danger: #e25b5b;

    /* Mapped Theme Variables */
    --bg-app: var(--c-navy-900);
    --bg-surface: var(--c-navy-800);
    --bg-surface-2: var(--c-navy-700);
    --border-soft: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.16);
    
    --fg-1: #ffffff;
    --fg-2: var(--c-ink-200);
    --fg-3: var(--c-ink-500);

    /* Typography */
    --font-sans: 'Poppins', sans-serif;
    --lh-normal: 1.4;
    --lh-relaxed: 1.6;
    
    /* Shapes / Radii */
    --r-xs: 6px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;
    --r-pill: 999px;

    /* Shadows */
    --shadow-1: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-2: 0 8px 24px rgba(0,0,0,0.25);
    --shadow-3: 0 16px 40px rgba(0,0,0,0.4);
    --shadow-glow-spark: 0 8px 24px var(--c-spark-tint);

    /* Layout */
    --nav-height: 60px;
    --top-height: 56px;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--fg-1);
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Typography Classes */
h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 32px; font-weight: 600; }
h3 { font-size: 24px; font-weight: 600; }
h4 { font-size: 20px; font-weight: 500; }
.text-body { font-size: 15px; font-weight: 400; color: var(--fg-2); }
.text-overline { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-3); }

/* Logo Lockup */
.brand-logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    color: var(--fg-1);
}
.brand-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--c-spark);
    border-radius: 2px;
    margin: 0 3px;
    transform: translateY(2px);
}

/* App Container */
.app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--bg-app);
    position: relative;
    box-shadow: var(--shadow-3);
    overflow: hidden;
}

/* Header */
.app-header {
    height: var(--top-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(13, 20, 32, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
    z-index: 10;
}

.header-action {
    color: var(--fg-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    transition: background 0.2s, transform 0.1s;
}
.header-action:active {
    transform: scale(0.95);
}

/* Main Views */
.content-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}
.app-view {
    flex: 1;
    overflow: auto;
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
}
.app-view.active {
    display: flex;
}

/* Swipe Container */
.swipe-container {
    flex: 1;
    position: relative;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    width: 100%;
    flex: 1;
}
.empty-state-icon {
    width: 96px;
    height: 96px;
    background: var(--bg-surface-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-1);
}
.empty-state h3 {
    margin-bottom: 8px;
    color: var(--fg-1);
}
.empty-state p {
    color: var(--fg-3);
    font-size: 15px;
    line-height: 1.5;
    max-width: 280px;
}

/* Profile Card */
.profile-card {
    position: absolute;
    width: calc(100% - 32px);
    height: calc(100% - 32px);
    background-color: var(--bg-surface);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--shadow-2);
    display: flex;
    flex-direction: column;
    cursor: grab;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: 50% 100%;
    border: 1px solid var(--border-soft);
}
.profile-card:active {
    cursor: grabbing;
}
.card-image-container {
    flex: 6;
    position: relative;
    background-color: var(--c-navy-700);
}
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(15,26,46,0) 0%, rgba(15,26,46,1) 100%);
    pointer-events: none;
}
.card-info {
    flex: 4;
    padding: 16px;
    background-color: var(--bg-surface);
    display: flex;
    flex-direction: column;
}
.card-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--fg-1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-subtitle {
    font-size: 13px;
    color: var(--fg-3);
    margin-top: 4px;
}
.card-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.card-pill {
    font-size: 11px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: var(--bg-surface-2);
    color: var(--fg-2);
    border: 1px solid var(--border-soft);
}

/* Stamps */
.stamp {
    position: absolute;
    top: 40px;
    padding: 8px 16px;
    border: 4px solid;
    border-radius: var(--r-md);
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0;
    z-index: 10;
    transform: rotate(0deg);
}
.stamp-like { color: var(--c-success); border-color: var(--c-success); left: 20px; transform: rotate(-15deg); }
.stamp-nope { color: var(--c-danger); border-color: var(--c-danger); right: 20px; transform: rotate(15deg); }

/* Controls */
.action-buttons {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    background: var(--bg-app);
}
.action-btn {
    border: none;
    border-radius: var(--r-pill);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-1);
    transition: transform 0.12s cubic-bezier(0.65, 0, 0.35, 1), box-shadow 0.12s, background 0.12s;
}
.action-btn:active {
    transform: scale(0.9);
}
.btn-nope {
    width: 60px;
    height: 60px;
    color: var(--fg-2);
    border: 1px solid var(--border-strong);
}
.btn-nope:hover { border-color: var(--c-danger); color: var(--c-danger); }
.btn-superlike {
    width: 52px;
    height: 52px;
    color: var(--c-trust);
    border: 1px solid var(--c-trust);
    background: transparent;
}
.btn-like {
    width: 64px;
    height: 64px;
    background-color: var(--c-spark);
    color: white;
    box-shadow: var(--shadow-glow-spark);
}
.btn-like:hover { background-color: var(--c-spark-hover); }

/* Bottom Navigation */
.bottom-nav {
    height: var(--nav-height);
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}
.nav-item {
    color: var(--fg-3);
    cursor: pointer;
    padding: 10px;
    border-radius: var(--r-pill);
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-item.active {
    color: var(--c-spark);
}
.nav-item:hover {
    background: var(--bg-surface-2);
}

/* Auth / Forms */
.auth-container {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}
.input-field {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 16px;
    background-color: var(--bg-surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--fg-1);
    outline: none;
    transition: border-color 0.2s;
}
.input-field:focus {
    border-color: var(--c-spark);
}
.btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--r-pill);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, transform 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background-color: var(--c-spark);
    color: white;
}
.btn-primary:hover { background-color: var(--c-spark-hover); }
.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-strong);
    color: var(--fg-1);
}
.btn-outline:hover { border-color: var(--fg-2); }
.btn-text {
    background: none;
    border: none;
    color: var(--fg-2);
    font-size: 13px;
    cursor: pointer;
    margin-top: 16px;
}
.btn-text b { color: var(--c-spark); }
.error-msg {
    color: var(--c-danger);
    font-size: 13px;
    margin-bottom: 16px;
    background: rgba(226,91,91,0.08);
    border: 1px solid rgba(226,91,91,0.25);
    padding: 12px;
    border-radius: var(--r-sm);
}

/* Match Overlay */
.match-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 11, 12, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 24px;
}
.match-title {
    font-family: var(--font-sans);
    font-size: 40px;
    font-weight: 700;
    color: var(--c-trust);
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

/* SSO Dividers */
.sso-divider {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 24px 0;
    color: var(--fg-3);
    font-size: 12px;
}
.sso-divider::before, .sso-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-soft);
}
.sso-divider span { padding: 0 16px; }

.sso-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg-surface);
    color: var(--fg-1);
}
.sso-btn:hover { background: var(--bg-surface-2); }

/* Profile Editor */
.profile-preview-img {
    width: 120px;
    height: 120px;
    border-radius: var(--r-pill);
    object-fit: cover;
    border: 2px solid var(--border-strong);
}
.profile-image-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 24px;
}

/* Chat & Match List UI */
.match-list-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-soft);
    cursor: pointer;
    transition: background 0.2s;
}
.match-list-item:hover {
    background: var(--bg-surface-2);
}
.match-list-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-surface-2);
    margin-right: 16px;
}
.match-list-info {
    flex: 1;
}
.match-list-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--fg-1);
    margin-bottom: 4px;
}
.match-list-preview {
    font-size: 14px;
    color: var(--fg-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Chat Overlay */
.chat-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-app);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-overlay.active {
    transform: translateX(0);
}
.chat-header {
    height: var(--top-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(13, 20, 32, 0.82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
    z-index: 10;
}
.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.chat-messages {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-input-area {
    padding: 16px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-soft);
}

/* Chat Bubbles */
.chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}
.chat-bubble-me {
    align-self: flex-end;
    background: var(--c-spark);
    color: white;
    border-radius: 20px 20px 4px 20px;
}
.chat-bubble-them {
    align-self: flex-start;
    background: var(--bg-surface-2);
    color: var(--fg-1);
    border-radius: 20px 20px 20px 4px;
}
