/* Moura Dating App - Custom Styles */

/* Import fonts */
@font-face {
    font-family: 'Heavy Heap';
    src: url('../fonts/heavy_heap.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Almanach';
    src: url('../fonts/AlmanachTest-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Almanach';
    src: url('../fonts/AlmanachTest-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables for Moura Color Scheme */
:root {
    --bg-primary: #161616;
    --bg-secondary: #1a1a1a;
    --bg-card: #202020;
    --accent-pink: #D05888;
    --accent-yellow: #DEBD0E;
    --text-primary: #FAFAFA;
    --text-secondary: #B0B0B0;
    --text-muted: #808080;
    --border-color: #333333;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --heading-size: 1.2rem; /* heading size */
    --card-hpad: 1rem; /* unified horizontal padding for text inside cards */
    --container-hpad: 1rem; /* horizontal padding for full-bleed headers to match container */
    --cta-right: 8px; /* distance of flick button from card edge and scroll tail gap */
    --photo-left-extra: 2px; /* tweak: tiny extra so photo+button visually align */
    /* spacing */
    --daily-top-gap: 12px; /* top gap that visually precedes daily match */
    /* feed layout variables */
    --photo-width: 220px;
    --peek-width: 0px; /* show full text width; photo starts offscreen */
    /* Global safe area: system + Telegram controls (fallbacks included) */
    --app-safe-top: calc(
        var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px))
        + var(--tg-content-safe-area-inset-top, 0px)
    );
    --app-safe-bottom: calc(
        var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))
        + var(--tg-content-safe-area-inset-bottom, 0px)
    );
}

/* Mobile tuning */
@media (max-width: 480px) {
  :root { --photo-width: 180px; --peek-width: 96px; }
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Almanach', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Root container padding to avoid Telegram fullscreen header overlap */
.app-root {
    padding-top: var(--app-safe-top, 0px);
    /* Optionally guard bottom gestures/home pill; keep minimal to not break layouts */
    padding-bottom: max(0px, var(--app-safe-bottom, 0px));
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Brand Styling */
.brand-flick { color: var(--accent-yellow); font-weight: 500; font-size: 1.5rem; }

.brand-moura { color: var(--accent-pink); font-weight: 500; font-size: 1.5rem; margin-left: 0.5rem; }

.brand-logo .brand-flick {
    font-size: 3rem;
}

.brand-logo .brand-moura {
    font-size: 3rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0.25rem 0; /* tighter vertical paddings */
    padding-bottom: calc(0.25rem + var(--app-safe-bottom, 0px));
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 12px;
}

.bottom-nav-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0.25rem;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--accent-pink);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(208, 88, 136, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(208, 88, 136, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(208, 88, 136, 0);
    }
}

.bottom-nav-icon svg {
    width: 100%;
    height: 100%;
    color: inherit;
    transition: all 0.3s ease;
}

/* Mask-based SVG icon so it inherits currentColor */
.icon-svg { display:block; width:100%; height:100%; background: currentColor; -webkit-mask: var(--icon-url) no-repeat center / contain; mask: var(--icon-url) no-repeat center / contain; }
.icon-svg.small { width:20px; height:20px; }
/* Larger flick action icon when used inside buttons */
.icon-svg.icon-flick-action { width:22px; height:22px; }

/* Active states with specified colors */
.bottom-nav-item[data-page="feed"].active {
    color: #D05888;
}



.bottom-nav-item[data-page="flicks"].active {
    color: #DEBD0E;
}

.bottom-nav-item[data-page="profile"].active {
    color: #FFFFFF;
}

/* Hover effects */
.bottom-nav-item:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Ensure any Bootstrap sticky headers respect Telegram safe top */
.sticky-top { top: var(--app-safe-top, 0px) !important; }

/* Moura logo icon styles */
.moura-cross-dot {
    fill: currentColor;
}

.moura-cross-stroke {
    stroke: currentColor;
    stroke-width: 6;
    stroke-linecap: round;
    fill: none;
}

/* Fire+match icon styles */
.fire-match-icon {
    color: inherit;
}

.fire-match-icon-inline {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.25rem;
    color: inherit;
}

/* Hat icon styles */
.hat-icon {
    color: inherit;
}

/* Add bottom padding to main content to prevent overlap */
main { padding-bottom: 64px; }

/* Toggle functionality for feed */
.view-toggle {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
}

.toggle-btn {
    border: 1px solid var(--border-color) !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    color: var(--text-primary) !important;
    border-color: var(--accent-yellow) !important;
}

.toggle-btn.active {
    background: var(--accent-yellow) !important;
    color: var(--bg-primary) !important;
    border-color: var(--accent-yellow) !important;
}

.content-view {
    display: none;
    transition: all 0.3s ease;
}

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

.message-highlighted {
    font-style: italic;
    border-left: 3px solid var(--accent-yellow);
    padding-left: 0.75rem;
    margin-left: 0;
}

/* Navigation (keeping for potential future use) */
.navbar {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
    display: none; /* Hidden since we removed the top nav */
}

.navbar-brand {
    text-decoration: none !important;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--text-primary) !important;
    background: var(--bg-card);
}

/* Buttons */
.btn {
    border-radius: 12px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-pink);
    color: white;
}

.btn-primary:hover {
    background: #b84a74;
    color: white;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 2px solid var(--accent-pink);
    color: var(--accent-pink);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--accent-pink);
    color: white;
}

/* Flick Button Styles */
.btn-flick {
    background: #DEBD0E;
    border: none;
    color: #FFFFFF;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-flick:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(222, 189, 14, 0.4);
    color: #FFFFFF;
    background: #DEBD0E;
}

.btn-flick:focus {
    box-shadow: 0 0 0 0.2rem rgba(222, 189, 14, 0.5);
    color: #FFFFFF;
    background: #DEBD0E;
}

.btn-flick.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; }

.btn-outline-flick {
    border: 2px solid #DEBD0E;
    color: #DEBD0E;
    background: transparent;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-outline-flick:hover {
    background: #DEBD0E;
    color: var(--bg-primary);
    transform: translateY(-1px);
}

/* Matches Icon Styles */
.matches-icon-inline {
    flex-shrink: 0;
}

/* Redesigned Feed Styles */
.feed-card-redesigned {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 0; /* no horizontal padding: scroller goes edge-to-edge */
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.feed-card-redesigned:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Gap between text and photo strip is computed so the left edge of the first photo aligns with the left edge of the flick button */
.feed-card-v2 { --feed-gap: calc(var(--cta-right) + var(--photo-left-extra, 2px)); }
.feed-content { display: flex; gap: var(--feed-gap, 1rem); align-items: stretch; }

/* Horizontal scroll so text+photos move together; shows only part of photo initially */
.feed-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; padding-right: var(--cta-right); }
.feed-scroll::-webkit-scrollbar { display: none; }

/* Make inner content wider than the card by the hidden part of the photo */
.feed-card-redesigned { overflow: hidden; }
/* Default to one photo; allow overriding via --photo-count on card */
.feed-scroll .feed-content { width: calc(100% + (var(--photo-width) * var(--photo-count, 1)) - var(--peek-width) + ((var(--photo-count, 1) - 1) * var(--photo-gap, 8px)) + var(--feed-gap, 16px) + var(--photo-extras-width, 0px)); }
.feed-main-content { flex: 0 0 calc(100% - var(--peek-width)); min-width: 0; padding-left: var(--card-hpad); }
.feed-photo-right { flex: 0 0 auto; }

.feed-photos-left {
    flex-shrink: 0;
    width: 200px;
    height: 240px;
}

.feed-photo-main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* New right-side photo block */
.feed-photo-right {
    order: 2;
    /* Width adapts to number of photos while keeping each fixed size */
    width: calc(var(--photo-width) * var(--photo-count, 1) + ((var(--photo-count, 1) - 1) * var(--photo-gap, 8px)) + var(--photo-extras-width, 0px));
    height: auto; /* grow with content */
    border-radius: 12px;
    position: relative;
    display: flex;
    gap: var(--photo-gap, 8px);
    overflow-x: hidden; /* outer container handles horizontal scroll */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    margin-right: 0; /* flush with card edge */
    margin-bottom: 0;
}

/* Hide scrollbars for the photo strip */
.feed-photo-right::-webkit-scrollbar { display: none; }

/* Each slide is a fixed-size tile with the yellow border */
.feed-photo-right .photo-slide {
    flex: 0 0 auto;
    width: var(--photo-width);
    height: 100%;
    border: 2px solid var(--accent-yellow);
    border-radius: 12px;
    overflow: hidden;
    scroll-snap-align: start;
}

.feed-photo-right .photo-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Limit rendered slides count by markup; if more appear, hide extras beyond first two */
.feed-card-v2 .feed-photo-right .photo-slide:nth-child(n+3) { display: none; }

/* Default extra width reservation: one addon frame (1.5 photo width + one gap) */
.feed-card-v2 { --photo-extras-width: calc(var(--photo-width) * 1.5 + var(--photo-gap, 8px)); }
/* Make gap between last photo and the gray frame equal to the text gap */
.feed-card-v2 { --frame-left-gap: max(0px, calc(var(--feed-gap, 16px) - var(--photo-gap, 8px))); }

/* Addon frame that appears as the last item in the photo strip */
.photo-frame-extra {
    flex: 0 0 auto;
    width: calc(var(--photo-width) * 1.5);
    height: 80%;
    background: #333333;
    border-radius: 12px; /* same as .btn-flick */
    align-self: center;  /* center vertically within the strip */
    scroll-snap-align: start;
    /* Extra spacing before the frame so that (last photo — frame) gap equals (frame — text) gap */
    margin-left: var(--frame-left-gap, 0px);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Sticky selector aligned with card/container edges (no full-bleed) */
.feed-selector {
    position: sticky;
    top: var(--app-safe-top, 0px);
    z-index: 50;
    background: var(--bg-primary);
    padding: 0.5rem 0; /* vertical only; let container control horizontal */
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}
/* Paint safe-area strip above; fade-only to avoid top seam during scroll */
.feed-selector::before { content: ""; position: absolute; left: 0; right: 0; top: calc(-1 * var(--app-safe-top, 0px) - var(--sa-fix, 2px)); height: calc(var(--app-safe-top, 0px) + var(--sa-fix, 2px)); background: var(--bg-primary); pointer-events: none; will-change: opacity; opacity: 0; transition: opacity 200ms ease; }
.feed-selector.is-stuck { box-shadow: 0 1px 0 rgba(0,0,0,0.2); }
.feed-selector.is-stuck::before { opacity: 1; }
/* Fixed cover for feed safe-area to avoid seams on some WebViews */
.feed-safearea-cover { position: fixed; left: 0; right: 0; top: 0; height: calc(var(--app-safe-top, 0px) + var(--sa-fix, 12px)); background: var(--bg-primary); z-index: 49; pointer-events: none; opacity: 0; transition: opacity 160ms ease; }
.feed-safearea-cover.on { opacity: 1; }
/* Removed sheen to avoid white cast over header */
.selector-tab { background: transparent; border: 0; color: var(--text-secondary); font-size: var(--heading-size); transition: color 160ms linear; padding-left: 0; padding-right: 0; margin: 0; }
.selector-tab.active { color: var(--accent-pink); }
.selector-tab:focus { outline: none; }

/* Ensure left padding of the feed page (including Daily Match) matches the sticky header */
.feed-gesture.container {
    padding-left: max(var(--container-hpad), env(safe-area-inset-left, 0px));
    padding-right: max(var(--container-hpad), env(safe-area-inset-right, 0px));
}

/* Likes photo grid */
.liked-photo-grid { order: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 220px; }
.liked-photo { width: 100%; height: 110px; object-fit: cover; border: 2px solid var(--accent-yellow); border-radius: 10px; }

.feed-main-content {
    flex: 1;
    position: relative;
    min-height: unset; /* allow description to expand card height */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-bottom: 2rem; /* reserve space for compatibility badge */
}

.feed-bio-main {
    margin-bottom: 1rem;
}

.bio-text {
    font-size: 1.0rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
    font-weight: 400;
}

/* Collapsible bio with ellipsis */
.bio-text.collapsible { cursor: pointer; }
.bio-text.collapsible.expanded { cursor: default; }

/* removed more-toggle button in favor of tap-to-expand */

/* Compatibility badge bottom-left of card text */
.compatibility-badge {
    position: absolute;
    left: var(--card-hpad);
    bottom: 0.75rem;
    background: var(--accent-pink);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Flick button overlay on photo */
.feed-photo-cta {
    position: absolute;
    right: var(--cta-right);
    bottom: 8px;
    border-radius: 12px;
    z-index: 2;
}

/* Bottom sheet styles (added) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); z-index: 1050; display:none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg-card); border-top-left-radius: 16px; border-top-right-radius: 16px; box-shadow: 0 -8px 24px rgba(0,0,0,.5); transform: translateY(100%); transition: transform .25s ease; z-index: 1060; visibility: hidden; pointer-events: none; max-height: 85vh; }
.sheet.open { transform: translateY(0); visibility: visible; pointer-events: auto; }
.sheet-backdrop.open { display:block; }
.sheet-header { padding: .75rem 1rem; border-bottom: 1px solid var(--border-color); display:flex; justify-content: center; align-items:center; }
.sheet-title { margin: 0; font-size: 1.05rem; text-align: center; }
.sheet-body { padding: 1rem; }
.sheet-footer { padding: .75rem 1rem; border-top: 1px solid var(--border-color); display:grid; grid-template-columns: 1fr 1fr; gap:.6rem; }
.sheet-footer .btn { width: 100%; justify-content: center; align-items: center; }
.flick-textarea { width: 100%; }

.feed-bottom-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: auto;
}

.compatibility-percent {
    background: var(--accent-pink);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.carousel-photo {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-photo.active {
    opacity: 1;
}

.feed-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.avatar-placeholder-feed {
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.avatar-placeholder-feed i {
    width: 30px;
    height: 30px;
}

.photo-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-carousel:hover .photo-navigation {
    opacity: 1;
}

.photo-nav {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.photo-dots {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.25rem;
}

.dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.dot.active {
    background: white;
    transform: scale(1.5);
}

/* Expanded Incoming Likes Styles */
.incoming-like-card-expanded {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.incoming-like-card-expanded:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Likes strip (drag to scroll) */
.liked-photo-strip { order: 2; display: flex; gap: 8px; width: 220px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.liked-photo-strip::-webkit-scrollbar { display: none; }
.liked-photo { width: 100px; height: 100px; object-fit: cover; border: 2px solid var(--accent-yellow); border-radius: 10px; flex: 0 0 auto; }

/* Drag-scroll helper */
.drag-scroll { cursor: grab; touch-action: pan-y; }
.drag-scroll.dragging { cursor: grabbing; }
/* While dragging over text, don't select text/images */
.dragging { user-select: none; }

/* Prevent native image dragging/selecting in carousels */
.feed-photo-right img, .liked-photo-strip img {
    -webkit-user-drag: none;
    user-drag: none;
    user-select: none;
}

/* Weight normalization to 'medium' across key elements */
h1, h2, h3, h4, h5, h6,
.section-title, .section-title-small, .section-title-lower,
.profile-title, .flicks-min-name, .like-name,
.btn, .btn-flick,
.compatibility-percent, .compatibility-badge {
    font-weight: 500 !important;
}

.like-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.profile-image-normal {
    flex-shrink: 0;
    width: 200px;
    height: 240px;
}

.profile-image-normal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.like-content {
    flex: 1;
    min-width: 0;
}

.like-name-section {
    margin-bottom: 0.5rem;
}

.like-name { margin: 0; font-size: 1rem; font-weight: 500; color: var(--text-primary); }

.like-action {
    flex-shrink: 0;
    align-self: flex-start;
}

.like-message-expanded {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 0.75rem;
    border-left: 3px solid var(--accent-pink);
}

.message-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    font-style: italic;
}

/* Content Toggle Styles */
.content-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.toggle-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn.active {
    background: var(--accent-pink);
    color: white;
    border-color: var(--accent-pink);
}

.toggle-btn:hover {
    background: var(--accent-pink);
    color: white;
    border-color: var(--accent-pink);
}

/* Message highlighting */
.message-highlighted {
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-pink);
    padding: 0.75rem;
    border-radius: 8px;
    font-style: italic;
    color: var(--text-primary);
}

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

.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-outline-secondary {
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Forms */
.form-control {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: var(--bg-card);
    border-color: var(--accent-pink);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(208, 88, 136, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-check-input {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--accent-pink);
    border-color: var(--accent-pink);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(208, 88, 136, 0.25);
}

.form-check-label {
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
}

.card-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0 !important;
}

.card-body {
    padding: 1.5rem;
}

/* Landing Page */
.landing-hero {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-content {
    z-index: 2;
    position: relative;
}

.hero-title { font-size: 3.5rem; font-weight: 500; line-height: 1.1; margin-bottom: 1.5rem; }

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.feature-icon {
    color: var(--accent-pink);
    flex-shrink: 0;
}

/* Floating Cards Animation */
.hero-visual {
    position: relative;
    height: 400px;
}

.floating-cards {
    position: relative;
    width: 100%;
    height: 100%;
}

.card-demo {
    position: absolute;
    width: 200px;
    height: 120px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInFloat 0.8s ease-out forwards;
}

.card-demo-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0.2s;
}

.card-demo-2 {
    top: 40%;
    right: 20%;
    animation-delay: 0.4s;
}

.card-demo-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 0.6s;
}

.card-content {
    text-align: center;
    color: var(--text-primary);
}

.card-content i {
    color: var(--accent-yellow);
    margin-bottom: 0.5rem;
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Landing Features */
.landing-features {
    background: var(--bg-secondary);
}

.feature-box {
    padding: 2rem 1rem;
}

.feature-icon-large {
    color: var(--accent-pink);
    margin-bottom: 1rem;
}

.feature-icon-large i {
    width: 48px;
    height: 48px;
}

/* Home Page */
.welcome-section {
    padding: 3rem 0;
}

.user-avatar {
    width: 80px;
    height: 80px;
    position: relative;
    margin: 0 auto;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.user-name {
    color: var(--accent-pink);
    font-weight: 600;
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    color: var(--accent-pink);
    flex-shrink: 0;
}

.stat-content h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.stat-status.completed {
    color: var(--success-color);
    font-size: 0.9rem;
}

.stat-number {
    color: var(--accent-yellow);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Action Cards */
.action-cards {
    margin: 3rem 0;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-pink);
}

.action-card.primary {
    background: linear-gradient(135deg, var(--accent-pink) 0%, #b84a74 100%);
    color: white;
}

.action-card.primary .action-icon {
    color: white;
}

.action-card.secondary {
    background: var(--bg-card);
}

.action-icon {
    color: var(--accent-pink);
    margin-bottom: 1rem;
}

.action-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.action-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.action-card.primary .action-content p {
    color: rgba(255, 255, 255, 0.8);
}

/* Recent Activity */
.recent-activity {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
}

.section-title { font-size: var(--heading-size); font-weight: 500; margin-bottom: 1.5rem; }

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.activity-icon {
    color: var(--success-color);
    flex-shrink: 0;
}

.activity-content p {
    margin: 0;
    font-weight: 500;
}

.activity-time {
    color: var(--text-muted);
}

/* Discovery Page */
.discovery-header {
    padding: 2rem 0;
}

.discovery-icon {
    margin-bottom: 2rem;
}

.sparkle-icon {
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.1) rotate(180deg);
        opacity: 0.8;
    }
}

.discovery-title { font-size: 3rem; font-weight: 500; margin-bottom: 1rem; }

.discovery-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.discovery-form {
    max-width: 800px;
    margin: 0 auto;
}

.discovery-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-title { display: flex; align-items: center; gap: 0.75rem; font-size: var(--heading-size); font-weight: 500; margin-bottom: 0.5rem; }

/* Compact section titles inside profile form */
.profile-form .section-title { font-size: 1.2rem; gap: 0.5rem; margin-bottom: 0.4rem; }
.profile-form .section-title i { width: 18px; height: 18px; }

.section-title i {
    color: var(--accent-pink);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Checkbox and Radio Grids */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-check {
    margin: 0;
}

.radio-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.radio-card:hover {
    border-color: var(--accent-pink);
    background: var(--bg-card);
}

.radio-card .form-check-input {
    display: none;
}

.radio-card .form-check-input:checked + .form-check-label {
    color: var(--accent-pink);
}

.radio-card .form-check-input:checked + .form-check-label .radio-content {
    background: rgba(208, 88, 136, 0.1);
}

.radio-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.radio-content i {
    color: var(--accent-pink);
}

/* Profile Page */
.profile-header { padding: 1rem 0; }
/* A slim sticky safe-area cover for profile, appears when name reaches safe area */
.profile-stick-cover { position: sticky; top: var(--app-safe-top, 0px); z-index: 40; }
.profile-stick-cover::before {
  content: ""; position: absolute; left: 0; right: 0;
  top: calc(-1 * var(--app-safe-top, 0px) - var(--sa-fix, 2px)); height: calc(var(--app-safe-top, 0px) + var(--sa-fix, 2px));
  background: var(--bg-primary); pointer-events: none; will-change: opacity;
  opacity: 0; transition: opacity 200ms ease;
}
.profile-stick-cover.is-stuck::before { opacity: 1; }

.user-avatar-large { width: 88px; height: 88px; margin: 0 auto; }

.user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-large {
    width: 88px;
    height: 88px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.profile-title { font-size: 1.3rem; font-weight: 500; margin-bottom: .4rem; }

.profile-subtitle { font-size: 0.9rem; color: var(--text-secondary); }

.profile-form { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 0.75rem; }
.profile-form .section-title { display:none; }
.profile-form .form-group { margin-bottom: .6rem; }
.profile-form .form-label { margin-bottom: .25rem; }
.profile-form .form-control { padding: .5rem .75rem; }

.form-group { margin-bottom: 1rem; }

@media (max-width: 480px){
  /* Prevent iOS auto-zoom on inputs by keeping >=16px */
  .form-control, input, textarea, select { padding: .6rem .8rem; font-size: 1rem; }
  .btn{ padding: .6rem 1rem; font-size: .95rem; }
  .btn-lg{ padding: .8rem 1.2rem; font-size: 1rem; }
}

/* Extra guard for iOS Safari */
@supports (-webkit-touch-callout: none) {
  input, textarea, select { font-size: 16px; }
}

.discovery-summary { background: var(--bg-secondary); border-radius: 12px; padding: 1rem; }

.summary-section { margin-bottom: 1rem; }

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-section h4 { font-size: 1rem; font-weight: 500; margin-bottom: 0.5rem; color: var(--accent-pink); }

/* Settings-style blocks for profile (me) */
.settings-banner { display:flex; align-items:center; gap:.75rem; background: #2a2a2a; border:1px solid var(--border-color); border-radius: 12px; padding:.6rem .75rem; }
.settings-banner .banner-icon { width:22px; height:22px; color:#DEBD0E; }
.settings-banner .banner-text { flex:1; font-weight:500; }

.settings-list { background: var(--bg-card); border:1px solid var(--border-color); border-radius:12px; overflow:hidden; }
.settings-item { display:flex; align-items:center; gap:.75rem; padding:.7rem .9rem; text-decoration:none; color:var(--text-primary); border-bottom:1px solid var(--border-color); }
.settings-item:last-child { border-bottom:0; }
.settings-icon { width:22px; height:22px; color:var(--accent-pink); display:inline-flex; align-items:center; justify-content:center; }
.settings-title { font-size:1rem; }
.settings-chevron { margin-left:auto; color:var(--text-secondary); }
.badge-new { background:#533; color:#fff; border-radius:8px; padding:0 .35rem; font-size:.7rem; margin-left:.35rem; }

.settings-collapse > summary { list-style:none; cursor:pointer; }
.settings-collapse[open] > summary .settings-chevron { transform: rotate(90deg); }
.settings-body { padding: .5rem .75rem; border:1px solid var(--border-color); border-top:0; border-radius: 0 0 12px 12px; }

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.tag-list.small .tag {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
}

.summary-text {
    color: var(--text-secondary);
    margin: 0;
}

/* Matches Page */
.matches-header {
    padding: 2rem 0;
}

.matches-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.matches-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.matches-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.match-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.match-card-header {
    position: relative;
    height: 300px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-photos {
    width: 150px;
    height: 150px;
}

.user-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent-pink);
}

.user-photo-placeholder {
    width: 150px;
    height: 150px;
    background: var(--bg-secondary);
    border: 3px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.user-photo-placeholder i {
    width: 60px;
    height: 60px;
}

/* Matches page badge (scoped to avoid overriding feed) */
.match-card .compatibility-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-pink);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    text-align: center;
}

.compatibility-score {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.match-card-body {
    padding: 2rem;
}

.user-info {
    margin-bottom: 1.5rem;
}

.user-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-age {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 1.2rem;
}

.user-location {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.user-bio {
    color: var(--text-primary);
    line-height: 1.6;
}

.compatibility-breakdown {
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
}

.compatibility-breakdown h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent-pink);
}

.compatibility-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.compatibility-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.compatibility-label {
    min-width: 100px;
    font-weight: 500;
    color: var(--text-secondary);
}

.compatibility-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.compatibility-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
}

.compatibility-fill.conscious {
    background: var(--accent-yellow);
}

.compatibility-fill.unconscious {
    background: var(--accent-pink);
}

.compatibility-value {
    min-width: 30px;
    font-weight: 600;
    color: var(--text-primary);
}

.discovery-highlights {
    margin-bottom: 1.5rem;
}

.discovery-highlights h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent-pink);
}

.highlight-section {
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.highlight-label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 80px;
}

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

.match-card-actions {
    padding: 0 2rem 2rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.btn-action {
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
}

.btn-action span {
    font-size: 0.8rem;
}

.btn-pass:hover {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.btn-miss:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-type:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.btn-like:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.message-section textarea {
    resize: vertical;
}

/* Empty State */
.empty-state {
    padding: 3rem 0;
}

.empty-icon {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.empty-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Daily Match Compact Styles */
.daily-match-section { padding-top: var(--daily-top-gap); margin-top: 0; }
.daily-match-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.75rem 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden; /* clip inner button corners */
    position: relative; /* anchor for absolute flick button */
}
/* Absolute flick in daily match, pinned to right */
.daily-match-card .dm-flick { position: absolute; right: var(--cta-right); top: 50%; transform: translateY(-50%); margin: 0; z-index: 1; }

.daily-match-card--placeholder {
    height: 160px;
    opacity: 0.85;
}

.section-title-lower { text-transform: lowercase; letter-spacing: 0.3px; font-weight: 500; color: var(--text-primary); font-size: var(--heading-size); }
.fw-medium { font-weight: 500 !important; }

.people-header .pill {
    border: 1px solid var(--border-color);
    background: #1b1b1b;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.people-header .filter-icon { color: var(--text-secondary); }

.profile-image-compact {
    width: 60px;
    height: 60px;
}

.profile-image-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-compact {
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.match-info-compact h4 { margin-bottom: 0.1rem; font-size: 0.95rem; font-weight: 600; }
.match-details { color: var(--text-secondary); font-size: 0.8rem; margin-bottom: 0.25rem; }

.compatibility-mini { background: var(--accent-pink); color: white; padding: 0.2rem 0.45rem; border-radius: 8px; font-size: 0.75rem; font-weight: 600; display: inline-block; }

/* Incoming Likes Styles */
.incoming-likes-section {
    margin-bottom: 2rem;
}

.section-title-small { font-size: 1.25rem; font-weight: 500; margin-bottom: 1rem; color: var(--text-primary); }

/* Minimal flicks list */
.flicks-min-list { padding: 0.25rem 0; }
.flicks-min-item { padding: 0.5rem 0; color: var(--text-primary); }
.flicks-min-item:hover { opacity: 0.9; }
.flicks-ring { width: 66px; height: 66px; position: relative; border-radius: 50%; flex-shrink: 0;
  --r: 30px; /* radius for fuse position */
  background: conic-gradient(var(--accent-yellow) calc(var(--pct,1)*1turn), #202020 0);
}
.flicks-ring::after { content:""; position:absolute; inset:3px; border-radius:50%; background: var(--bg-primary); z-index:0; }
.flicks-min-avatar { position:absolute; inset:3px; overflow:hidden; border-radius:50%; z-index:1; }
.flicks-min-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flicks-fuse { position:absolute; left:50%; top:50%; transform: translate(-50%, -50%) rotate(calc(var(--pct,1) * 360deg)) translateY(calc(-1 * var(--r))); color:#DE4C0E; font-size:16px; font-weight:700; z-index:2; }
.flicks-min-name { font-size: 1.0rem; font-weight: 500; }
.flicks-min-name { font-weight: 500; }
.flicks-min-time { font-size: 0.8rem; color: var(--text-secondary) !important; }

/* Sticky header for flicks title */
.flicks-header-sticky {
  position: sticky;
  top: var(--app-safe-top, 0px);
  padding-top: .75rem; /* visual breathing room inside header */
  background: var(--bg-primary);
  z-index: 25;
  padding-bottom: .5rem;
}

/* Flicks grid/cards */
.flicks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.flick-card.matrix { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; display:flex; flex-direction: column; }
.flick-card .flick-header { display:flex; align-items:center; justify-content: space-between; gap: .75rem; padding: .75rem; border-bottom: 1px solid var(--border-color); }
.flick-card .flick-body { padding: .75rem; color: var(--text-secondary); }
.flick-card .flick-actions { padding: .75rem; border-top: 1px solid var(--border-color); display:flex; justify-content:flex-end; }
.profile-image-medium { width: 56px; height: 56px; overflow:hidden; border-radius:50%; border: 2px solid var(--border-color); }
.profile-image-medium img { width:100%; height:100%; object-fit:cover; display:block; }
.avatar-placeholder-medium { width: 56px; height:56px; background: var(--bg-secondary); border:2px solid var(--border-color); border-radius:50%; display:flex; align-items:center; justify-content:center; color: var(--text-muted); }
.profile-details { display:flex; flex-direction:column; }
.profile-name { margin: 0; font-size: 1rem; }
.profile-match { margin: 0; color: var(--text-secondary); font-size: .9rem; }
.status-badge.matrix { background: var(--accent-yellow); color: var(--bg-primary); border-radius: 10px; padding: .2rem .5rem; font-weight: 600; font-size: .8rem; }
/* Always cover safe-area above flicks header */
.flicks-header-sticky::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--app-safe-top, 0px) - var(--sa-fix, 2px));
  height: calc(var(--app-safe-top, 0px) + var(--sa-fix, 2px));
  background: var(--bg-primary);
  pointer-events: none;
  will-change: transform, opacity;
  transform: translateY(0);
  opacity: 1;
}

.incoming-like-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.profile-image-mini {
    width: 40px;
    height: 40px;
}

.profile-image-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-mini {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.like-name { font-size: 1rem; font-weight: 500; margin-bottom: 0.25rem; }

.like-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    font-style: italic;
}

/* Flick Modal Styles */
.flick-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.flick-modal-content .modal-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
}

.flick-textarea {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    resize: none; /* user cannot manually resize */
    min-height: 120px; /* base height */
    max-height: 180px; /* auto-grow until this limit, then scroll */
    overflow-y: auto;
}

.flick-textarea:focus {
    background: var(--bg-card);
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 0.2rem rgba(222, 189, 14, 0.25);
}

.user-preview {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.profile-preview-image {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* Flick Chat */
.flick-chat-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-top: .5rem !important;
    padding-bottom: .5rem !important;
    position: sticky;
    top: var(--app-safe-top, 0px);
    left: 0; right: 0;
    z-index: 60;
}

.chat-partner-info h5 {
    margin-bottom: 0;
    color: var(--text-primary);
}

.chat-partner-info small {
    color: var(--text-secondary);
}

.bond-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bond-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bond-percentage {
    background: var(--accent-yellow);
    color: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.flick-chat-container {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 0.75rem; /* compact; will add bottom pad via page class */
    overflow: hidden; /* no internal scroll in flick chat */
}

.card-deck-container {
    max-width: min(760px, calc(100vw - 2rem));
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-display {
    perspective: 1000px;
    margin-bottom: 1rem;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}

.flick-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    height: 100%;
    min-height: min(720px, 100%);
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.flick-card:hover {
    transform: translateY(-5px) rotateY(2deg);
}

/* Inner content tilts subtly with device/mouse orientation */
.flick-card .card-content {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 120ms ease-out;
    position: relative;
    z-index: 2; /* above gradient overlay */
}

/* Wrapper moved by device tilt (separate from swipe transforms) */
.flick-card .tilt-wrap{
    will-change: transform;
    transition: transform 80ms ease-out;
    height: 100%;
    position: relative;
    z-index: 2; /* above gradient overlay */
}

/* Enhanced card styling with gradients */
.flick-card.card-deep_connection {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.flick-card.card-music_sync {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.flick-card.card-values_alignment {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.flick-card.card-visual_journey {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 100%);
}

.flick-card.card-creative_expression {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.flick-card.card-mindful_game {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.flick-card.card-authentic_moment {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.flick-card.card-energy_check {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}
/* Readability on bright gradients */
.flick-card .card-title { color: #fff !important; }
.flick-card .card-description { color: rgba(255,255,255,0.95) !important; }
.flick-card .card-description-box { color: inherit; }

/* Subtle dim overlay over bright gradients for readability */
.flick-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.18));
    pointer-events: none;
    z-index: 1;
}

/* Card Icon Styling */
.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(10px);
}

.card-icon i {
    width: 30px;
    height: 30px;
    color: white;
}

/* Progress Dots */
.card-progress-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.progress-dot.completed {
    background: white;
}

/* Card Description Box */
.card-description-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.1rem;
    margin-bottom: 1.2rem;
    backdrop-filter: blur(10px);
}

/* Card Footer */
.card-footer {
    margin-top: auto;
    padding-top: 1rem;
}

.intuition-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
    font-style: italic;
}

/* Card Options */
.card-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2; /* ensure options are above any decorative layers */
    pointer-events: auto;
}

.card-option {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}

.card-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.card-option.selected {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.02);
}

.card-option.skip {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border-style: dashed;
}

.card-content {
    padding: 1.25rem; /* slightly tighter */
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.card-type-badge {
    background: var(--accent-pink);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
}

.card-progress {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.card-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.card-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.card-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    color: var(--text-primary);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.card-option:hover {
    border-color: var(--accent-pink);
    background: var(--bg-card);
    transform: translateY(-2px);
}

.card-option.selected {
    border-color: var(--accent-pink);
    background: rgba(208, 88, 136, 0.1);
    color: var(--accent-pink);
}

/* Stronger selected state to give instant feedback */
.flick-card .card-option.selected {
    background: rgba(222, 189, 14, 0.12);
    border-color: var(--accent-yellow);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25), 0 0 0 1px rgba(222,189,14,0.25) inset;
}

.flick-instructions {
    text-align: center;
    padding: 0.5rem 1rem 1rem;
}

.flick-instructions i {
    color: var(--accent-yellow);
    margin-right: 0.5rem;
}

/* Page-specific layout: remove global main bottom padding to avoid scroll, reserve space for bottom nav inside flick chat */
.page-flick-chat main { padding-bottom: 0 !important; }
.page-flick-chat .flick-chat-container { padding-bottom: calc(60px + var(--app-safe-bottom, 0px)); }
.page-flick-chat .app-root { overflow: hidden; }

/* Height-constrained tuning */
@media (max-height: 740px) {
  .card-title { font-size: 1.6rem; }
  .card-description { font-size: 1rem; }
  .card-icon { width: 52px; height: 52px; }
}
@media (max-height: 620px) {
  .card-title { font-size: 1.4rem; }
  .card-description { font-size: 0.95rem; }
  .card-description-box { padding: 0.9rem; }
  .card-option { padding: 0.65rem 0.75rem; font-size: 0.95rem; }
}

/* Matrix Page */
.matrix-header {
    padding: 3rem 0;
}

.matrix-logo {
    margin-bottom: 2rem;
}

.matrix-subtitle {
    color: var(--accent-yellow);
    font-weight: 400;
    margin-left: 0.5rem;
}

.matrix-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.matrix-subtitle-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.matrix-container {
    max-width: 1000px;
    margin: 0 auto;
}

.compatibility-overview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
}

.compatibility-circle {
    position: relative;
    width: 150px;
    height: 150px;
}

.circle-progress {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.circle-progress svg {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
}

.percentage {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-pink);
}

.compatibility-details h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.compatibility-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

.matrix-breakdown {
    margin: 3rem 0;
}

.matrix-dimension {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
}

.matrix-dimension.conscious {
    border-left: 4px solid var(--accent-yellow);
}

.matrix-dimension.unconscious {
    border-left: 4px solid var(--accent-pink);
}

.dimension-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dimension-header h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.dimension-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-pink);
}

.matrix-dimension.conscious .dimension-score {
    color: var(--accent-yellow);
}

.dimension-description {
    margin-bottom: 1.5rem;
}

.dimension-description p {
    color: var(--text-secondary);
    margin: 0;
}

.dimension-meter {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.meter-fill {
    height: 100%;
    border-radius: 4px;
    width: 0;
    transition: width 1.5s ease-out;
}

.meter-fill.conscious {
    background: var(--accent-yellow);
}

.meter-fill.unconscious {
    background: var(--accent-pink);
}

.dimension-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.matrix-analysis {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
}

.analysis-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.relationship-matrix {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.matrix-grid {
    display: grid;
    grid-template-columns: 80px repeat(4, 1fr);
    grid-template-rows: repeat(5, 50px);
    gap: 1px;
    background: var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.grid-cell {
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.8rem;
    text-align: center;
}

.grid-header {
    display: contents;
}

.grid-header .grid-cell {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--accent-pink);
}

.conscious-label {
    background: var(--bg-card) !important;
    font-weight: 600;
    color: var(--accent-yellow) !important;
}

.position-marker {
    position: absolute;
    transform: translate(-50%, 50%);
    z-index: 10;
}

.marker-dot {
    width: 12px;
    height: 12px;
    background: var(--accent-pink);
    border: 2px solid white;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
}

.marker-label {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    border: 1px solid var(--border-color);
}

.matrix-actions {
    margin-top: 3rem;
}

.action-button-group {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.matrix-note {
    margin-top: 1rem;
}

/* Waiting State */
.waiting-state {
    padding: 3rem 0;
}

.waiting-icon {
    margin-bottom: 2rem;
}

.spinner {
    width: 80px;
    height: 80px;
    position: relative;
    margin: 0 auto;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--accent-pink);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    border-top-color: var(--accent-yellow);
    animation-delay: -0.5s;
}

.spinner-ring:nth-child(3) {
    border-top-color: var(--text-muted);
    animation-delay: -1s;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.waiting-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Completion Modal */
.completion-icon {
    margin-bottom: 2rem;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Error Pages */
.error-icon {
    margin-bottom: 2rem;
}

.error-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.error-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Alerts */
.alert {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    border-color: var(--success-color);
    background: rgba(40, 167, 69, 0.1);
}

.alert-danger {
    border-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

.alert-info {
    border-color: var(--info-color);
    background: rgba(23, 162, 184, 0.1);
}

.alert-warning {
    border-color: var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
}

.alert i {
    flex-shrink: 0;
}

.alert-link {
    color: var(--accent-pink);
    text-decoration: none;
    font-weight: 600;
}

.alert-link:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .compatibility-overview {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem;
    }
    
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .checkbox-grid,
    .radio-cards {
        grid-template-columns: 1fr;
    }
    
    .hero-features {
        margin-top: 2rem;
    }
    
    .floating-cards {
        display: none;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .brand-logo .brand-flick,
    .brand-logo .brand-moura {
        font-size: 2rem;
    }
    
    .discovery-title {
        font-size: 2rem;
    }
    
    .matrix-title {
        font-size: 2rem;
    }
    
    .matches-title {
        font-size: 2rem;
    }
    
    .user-name {
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
    
    .discovery-section,
    .profile-form {
        padding: 1.5rem;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

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

.text-right {
    text-align: right;
}

.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mt-5 {
    margin-top: 3rem;
}

/* Form Validation */
.is-invalid {
    border-color: var(--danger-color) !important;
}

.is-valid {
    border-color: var(--success-color) !important;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Smooth Transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Focus States */
*:focus {
    outline: none;
}

.btn:focus,
.form-control:focus,
.card-option:focus {
    box-shadow: 0 0 0 0.2rem rgba(208, 88, 136, 0.25);
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .alert {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}
