/* === Customers Dream v4 — vibrant gradient theme === */

:root {
    --grad-a: #7b2ff7;
    --grad-b: #f107a3;
    --grad-c: #2bd2ff;
    --grad-d: #ff8a00;
    --accent: #8b5cff;
    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --nav-height: 66px;
    --header-height: 52px;
}

/* Dark theme (default) */
[data-theme="dark"] {
    --bg-primary: #0c0a18;
    --bg-secondary: #14112a;
    --bg-card: #1a1633;
    --bg-card-2: #221b40;
    --bg-elevated: #251d45;
    --text-primary: #f4f1ff;
    --text-secondary: #b3a9d6;
    --text-muted: #6f6699;
    --border: rgba(160, 130, 255, 0.12);
    --border-active: rgba(180, 150, 255, 0.45);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 8px 28px rgba(123, 47, 247, 0.35);
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f3f0fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-2: #f6f2ff;
    --bg-elevated: #ffffff;
    --text-primary: #1a1336;
    --text-secondary: #5a5080;
    --text-muted: #9a90bd;
    --border: rgba(123, 47, 247, 0.14);
    --border-active: rgba(123, 47, 247, 0.5);
    --shadow: 0 10px 30px rgba(123, 47, 247, 0.12);
    --shadow-glow: 0 8px 28px rgba(241, 7, 163, 0.22);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.3s, color 0.3s;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    background: var(--bg-primary);
}

/* === Gradient animated text === */
@keyframes gradflow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

.gradient-text {
    background: linear-gradient(90deg, var(--grad-a), var(--grad-b), var(--grad-c), var(--grad-d), var(--grad-a));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradflow 5s linear infinite;
    font-weight: 800;
}

/* === Header === */
.header {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
}

.header__back {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.15s;
}
.header__back:active { transform: scale(0.88); }

.header__title { flex: 1; text-align: center; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.header__spacer { width: 34px; flex-shrink: 0; }
.hidden { display: none !important; }
/* Keep the back button's slot reserved when hidden so the title stays centered */
.header__back { flex-shrink: 0; }
.header__back.hidden { display: flex !important; visibility: hidden; }

/* === Content === */
.content { flex: 1; overflow: hidden; position: relative; }

.page {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 14px;
    padding-bottom: calc(var(--nav-height) + 16px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s, transform 0.22s;
    transform: translateY(8px);
    -webkit-overflow-scrolling: touch;
}
.page.active { opacity: 1; visibility: visible; transform: translateY(0); }

/* === Banner carousel === */
.banner {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-glow);
}

.banner__track { display: flex; transition: transform 0.5s cubic-bezier(0.4,0,0.2,1); }

.banner__slide {
    min-width: 100%;
    padding: 22px 20px;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.banner__slide-title { font-size: 19px; font-weight: 800; color: #fff; line-height: 1.15; letter-spacing: -0.02em; position: relative; z-index: 2; }
.banner__slide-sub { font-size: 12.5px; color: rgba(255,255,255,0.9); margin-top: 6px; max-width: 70%; position: relative; z-index: 2; }
.banner__slide-emoji { position: absolute; right: -6px; bottom: -14px; font-size: 96px; opacity: 0.28; z-index: 1; transform: rotate(-12deg); }

.banner__dots { position: absolute; bottom: 8px; left: 20px; display: flex; gap: 6px; z-index: 3; }
.banner__dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.4); transition: all 0.3s; }
.banner__dot.active { width: 18px; border-radius: 4px; background: #fff; }

/* === Landing buttons === */
.landing-buttons { display: flex; flex-direction: column; gap: 12px; }

.landing-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    color: #fff;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}
.landing-btn:active { transform: scale(0.97); }
.landing-btn--catalog { background: linear-gradient(135deg, #7b2ff7, #f107a3); }
.landing-btn--custom { background: linear-gradient(135deg, #2bd2ff, #7b2ff7); }

.landing-btn__icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.18);
    border-radius: 13px; flex-shrink: 0; color: #fff;
}
.landing-btn__text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.landing-btn__text strong { font-size: 16px; font-weight: 800; }
.landing-btn__text small { font-size: 12px; color: rgba(255,255,255,0.85); }
.landing-btn__arrow { font-size: 22px; font-weight: 700; opacity: 0.9; }

/* === Home stats === */
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.home-stat {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px 8px; text-align: center;
}
.home-stat__value { font-size: 20px; font-weight: 800; }
.home-stat__label { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }

/* === Filter chips === */
.filters {
    display: flex; gap: 8px; padding-bottom: 14px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.chip {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 22px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}
.chip.active {
    background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.chip:active { transform: scale(0.94); }

/* === Categories grid === */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.grid__item {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 20px 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}
.grid__item::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
    opacity: 0; transition: opacity 0.2s; z-index: 0;
}
.grid__item:active { transform: scale(0.96); }
.grid__item:hover { border-color: var(--border-active); box-shadow: var(--shadow-glow); }
.grid__item.hidden-by-filter { display: none; }

.grid__emoji {
    width: 58px; height: 58px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(123,47,247,0.18), rgba(241,7,163,0.14));
    border: 1px solid var(--border);
    position: relative; z-index: 1;
}
.grid__label { font-size: 13px; font-weight: 700; color: var(--text-primary); text-align: center; line-height: 1.25; position: relative; z-index: 1; }

/* === List === */
.list { display: flex; flex-direction: column; gap: 10px; }
.list__item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer; transition: transform 0.15s, border-color 0.2s;
}
.list__item:active { transform: scale(0.98); }
.list__item:hover { border-color: var(--border-active); }
.list__item-emoji {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
    background: linear-gradient(135deg, rgba(123,47,247,0.18), rgba(43,210,255,0.12));
    border-radius: 12px; flex-shrink: 0;
}
.list__item-content { flex: 1; min-width: 0; }
.list__item-title { font-size: 14.5px; font-weight: 700; }
.list__item-subtitle { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.list__item-arrow { color: var(--text-muted); font-size: 18px; }

/* === Mockups grid === */
.mockups-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

.mockup-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden; cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.mockup-card:active { transform: scale(0.98); }
.mockup-card:hover { border-color: var(--border-active); box-shadow: var(--shadow-glow); }

.mockup-card__image {
    width: 100%; aspect-ratio: 16/9;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.mockup-card__image img { width: 100%; height: 100%; object-fit: cover; }
.mockup-card__image-emoji { font-size: 52px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }
.mockup-card__badge {
    position: absolute; top: 10px; left: 10px;
    font-size: 10px; font-weight: 700; color: #fff;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(6px);
    padding: 4px 9px; border-radius: 20px;
}
.mockup-card__body { padding: 12px 14px; }
.mockup-card__title { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.mockup-card__meta { font-size: 12px; display: flex; align-items: center; gap: 8px; }
.mockup-card__price {
    font-weight: 800;
    background: linear-gradient(90deg, var(--grad-c), var(--grad-a));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.mockup-card__like { margin-left: auto; font-size: 18px; color: var(--text-muted); transition: transform 0.15s; }
.mockup-card__like.liked { color: #ff3b6b; }
.mockup-card__like:active { transform: scale(1.3); }

/* === Mockup detail === */
.mockup-detail__image {
    width: 100%; aspect-ratio: 16/9;
    border-radius: var(--radius); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.mockup-detail__image img { width: 100%; height: 100%; object-fit: cover; }
.mockup-detail__image-emoji { font-size: 80px; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.35)); }
.mockup-detail__title { font-size: 20px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.02em; }
.mockup-detail__path { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.mockup-detail__tags { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.mockup-detail__tag {
    font-size: 11px; font-weight: 600; padding: 5px 11px; border-radius: 20px;
    background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text-secondary);
}
.mockup-detail__description { font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 14px; }
.mockup-detail__features {
    background: var(--bg-card); border-radius: var(--radius-sm);
    border: 1px solid var(--border); padding: 14px; margin-bottom: 14px;
}
.mockup-detail__features h3 { font-size: 12px; margin-bottom: 8px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.mockup-detail__features ul { list-style: none; padding: 0; }
.mockup-detail__features li { font-size: 13px; color: var(--text-secondary); padding: 4px 0 4px 20px; position: relative; }
.mockup-detail__features li::before { content: '✓'; position: absolute; left: 0; color: #2bd2ff; font-weight: 800; }
.mockup-detail__price { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.mockup-detail__actions { display: flex; gap: 10px; margin-bottom: 10px; }

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 13px 20px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 700; cursor: pointer; border: none;
    transition: transform 0.15s, box-shadow 0.2s; text-decoration: none;
}
.btn:active { transform: scale(0.96); }
.btn--primary { background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: #fff; box-shadow: var(--shadow-glow); }
.btn--ghost { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); }
.btn--like { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); min-width: 50px; font-size: 18px; }
.btn--like.liked { border-color: #ff3b6b; color: #ff3b6b; }
.btn--full { width: 100%; }
.btn--sm { padding: 10px 16px; font-size: 13px; }

/* === Nav bar === */
.nav-bar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px; height: var(--nav-height);
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-around;
    padding: 0 4px; padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 200;
}
.nav-bar__item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 16px; border: none; background: transparent;
    color: var(--text-muted); cursor: pointer; border-radius: 10px; transition: color 0.2s;
}
.nav-bar__item.active { color: var(--accent); }
.nav-bar__item.active .nav-bar__label { background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-bar__svg { width: 22px; height: 22px; }
.nav-bar__label { font-size: 10px; font-weight: 700; }

/* When a text field is focused (mobile keyboard open) hide the bottom nav so it
   doesn't float above the keyboard and cover the submit button. */
body.keyboard-open .nav-bar { display: none; }
body.keyboard-open .page { padding-bottom: 16px; }

/* === Page header === */
.page__header { margin-bottom: 14px; }
.page__title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }

/* === Chat === */
.chat-page { text-align: center; padding: 20px 0; }
.chat-page__icon { font-size: 52px; margin-bottom: 8px; }
.chat-page h2 { font-size: 19px; margin-bottom: 6px; }
.chat-page p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }

/* === Profile === */
.profile-page { padding: 4px 0; }
.profile-card {
    display: flex; align-items: center; gap: 14px; padding: 18px;
    border-radius: var(--radius); margin-bottom: 18px;
    background: linear-gradient(135deg, #7b2ff7, #f107a3);
    box-shadow: var(--shadow-glow);
}
.profile-card__avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; color: #fff;
}
.profile-card__name { font-size: 16px; font-weight: 800; color: #fff; }
.profile-card__id { font-size: 12px; color: rgba(255,255,255,0.8); margin-top: 2px; }

.profile-section { margin-bottom: 18px; }
.profile-section__title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }

.balance-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.balance-card__amount { font-size: 24px; font-weight: 800; }
.balance-card__sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.crypto-card { background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 14px; margin-top: 10px; }
.crypto-card__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.crypto-card__label { font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.crypto-card__copy { background: none; border: none; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; }
.crypto-card__address { font-size: 11px; font-family: monospace; color: var(--text-secondary); word-break: break-all; padding: 10px; background: var(--bg-primary); border-radius: var(--radius-xs); margin-bottom: 8px; }
.crypto-card__note { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

.referral-card { background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 16px; }
.referral-card__text { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 10px; }
.referral-card__link { font-size: 11px; font-family: monospace; color: var(--accent); word-break: break-all; padding: 10px; background: var(--bg-primary); border-radius: var(--radius-xs); margin-bottom: 10px; }
.referral-card__stats { display: flex; gap: 20px; margin-top: 12px; }
.referral-card__stat { display: flex; flex-direction: column; }
.referral-card__stat-value { font-size: 18px; font-weight: 800; }
.referral-card__stat-label { font-size: 10.5px; color: var(--text-muted); }

/* Menu */
.menu { display: flex; flex-direction: column; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; }
.menu__item {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 14px 16px; border: none; background: transparent;
    border-bottom: 1px solid var(--border); color: var(--text-primary);
    cursor: pointer; font-size: 14px; text-align: left;
}
.menu__item:last-child { border-bottom: none; }
.menu__item:active { background: var(--bg-card-2); }
.menu__icon { font-size: 18px; width: 24px; text-align: center; }
.menu__label { flex: 1; font-weight: 600; }
.menu__arrow { color: var(--text-muted); font-size: 20px; }
.menu__item--toggle { cursor: default; }

.seg { display: flex; background: var(--bg-primary); border-radius: 10px; padding: 3px; gap: 2px; }
.seg__btn { border: none; background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.seg__btn.active { background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: #fff; }

/* === Terms === */
.terms { padding: 8px 0; }
.terms h2 { font-size: 20px; margin-bottom: 16px; text-align: center; }
.terms__block { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; }
.terms__block h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--accent); }
.terms__block p { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.terms__accept { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 14px; font-style: italic; }

/* === Forms === */
.contact-form, .request-form { padding: 8px 0; }
.contact-form { text-align: center; padding-top: 16px; }
.contact-form h2 { font-size: 19px; margin-bottom: 6px; }
.contact-form p, .request-form p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; text-align: center; }
.input-label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 5px; margin-top: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.input-label:first-of-type { margin-top: 0; }
.input {
    width: 100%; padding: 12px 14px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px; font-family: inherit;
    resize: none; margin-bottom: 4px; outline: none; transition: border-color 0.2s;
}
.input:focus { border-color: var(--border-active); }
.input::placeholder { color: var(--text-muted); }

/* === Empty / Loading / Toast === */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state__icon { font-size: 48px; margin-bottom: 10px; }
.empty-state p { color: var(--text-secondary); font-size: 14px; margin-bottom: 14px; }

.request-cta { margin-top: 16px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; }
.request-cta p { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 10px; }

.toast {
    position: fixed; bottom: calc(var(--nav-height) + 14px); left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
    color: #fff; padding: 11px 22px; border-radius: 22px; font-size: 13px; font-weight: 700;
    box-shadow: var(--shadow-glow); z-index: 1000; opacity: 0; transition: all 0.3s;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Scrollbar === */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 4px; }
