/* ─── Reset & Base ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    background: #0f0f0f;
    color: #f0ece4;
    font-family: 'DM Sans', sans-serif;
    position: relative;
    overflow-x: hidden;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    outline: none;
}

/* ─── CSS Variables ─── */
:root {
    --bg: #0f0f0f;
    --surface: rgba(255,255,255,0.03);
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(232,93,38,0.3);
    --accent: #e85d26;
    --accent-dark: #d4461a;
    --accent-glow: rgba(232,93,38,0.3);
    --accent-bg: rgba(232,93,38,0.15);
    --accent-bg-light: rgba(232,93,38,0.1);
    --text-primary: #f0ece4;
    --text-secondary: #888;
    --text-muted: #666;
    --text-dim: #555;
    --text-heading: #d0ccc4;
    --green: #22c55e;
    --yellow: #facc15;
    --red: #ef4444;
    --grab-green: #00b978;
    --price-cheap: #22c55e;
    --price-moderate: #f59e0b;
    --price-upscale: #f97316;
    --price-fine: #ef4444;
    --font-display: 'Playfair Display', serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;
}

/* ─── Keyframe Animations ─── */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ─── Layout ─── */
.app-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.screen {
    display: none;
}

.screen--active {
    display: block;
}

/* ─── Ambient Orbs ─── */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.ambient-orb--top {
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(232,93,38,0.06) 0%, transparent 70%);
}

.ambient-orb--bottom {
    bottom: -300px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(232,93,38,0.04) 0%, transparent 70%);
}

/* ─── Header ─── */
.header {
    padding-top: 40px;
    padding-bottom: 20px;
    text-align: center;
    animation: fadeSlideIn 0.5s ease both;
}

.header__emoji {
    font-size: 36px;
    margin-bottom: 6px;
    filter: drop-shadow(0 0 20px rgba(232,93,38,0.3));
}

.header__title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #f0ece4, #e85d26);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header__subtitle {
    font-size: 13px;
    color: #777;
    margin-top: 6px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* ─── Location Badge ─── */
.location-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
    animation: fadeSlideIn 0.5s ease 0.1s both;
}

.location-badge__pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.location-badge--requesting .location-badge__pill {
    background: rgba(250,204,21,0.1);
    border: 1px solid rgba(250,204,21,0.2);
}

.location-badge--granted .location-badge__pill {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.2);
}

.location-badge--denied .location-badge__pill {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.15);
}

.location-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.location-badge--requesting .location-badge__dot {
    background: var(--yellow);
    animation: pulse 1.5s infinite;
}

.location-badge--granted .location-badge__dot {
    background: var(--green);
    box-shadow: 0 0 8px rgba(34,197,94,0.5);
}

.location-badge--denied .location-badge__dot {
    background: var(--red);
}

.location-badge__text {
    font-size: 12px;
    color: #aaa;
    font-weight: 500;
}

/* ─── Preference Sections ─── */
.pref-section {
    margin-bottom: 24px;
}

.pref-section__title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

/* ─── Chip Toggle ─── */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: #a0a0a0;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.chip:active {
    transform: scale(0.96);
}

.chip--active {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 600;
}

.chip__icon {
    font-size: 15px;
    line-height: 1;
}

.chip__desc {
    font-size: 11px;
    opacity: 0.6;
    margin-left: 2px;
}

/* ─── Clear Selection Link ─── */
.clear-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    text-decoration: underline;
    -webkit-tap-highlight-color: transparent;
}

/* ─── Auto-detect Link ─── */
.auto-detect-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
}

/* ─── Radius Segmented Control ─── */
.radius-group {
    display: flex;
    gap: 8px;
}

.radius-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.radius-btn:active {
    transform: scale(0.96);
}

.radius-btn--active {
    border-color: var(--accent);
    background: rgba(232,93,38,0.12);
    color: var(--accent);
}

/* ─── CTA Button ─── */
.cta-wrapper {
    padding-top: 16px;
    padding-bottom: 40px;
}

.cta-btn {
    width: 100%;
    padding: 16px 0;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #e85d26, #d4461a);
    color: #fff;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 24px rgba(232,93,38,0.3);
    letter-spacing: 0.3px;
    -webkit-tap-highlight-color: transparent;
}

.cta-btn:active {
    transform: scale(0.98);
}

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

.cta-btn--disabled:active {
    transform: none;
}

/* ─── Loading Screen ─── */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 20px;
    animation: fadeIn 0.3s ease;
}

.loading__emoji {
    font-size: 48px;
    animation: pulse 1.5s ease infinite;
}

.loading__dots {
    display: flex;
    align-items: center;
    gap: 12px;
}

.loading__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

.loading__dot:nth-child(1) { animation: pulse 1.2s ease-in-out 0s infinite; }
.loading__dot:nth-child(2) { animation: pulse 1.2s ease-in-out 0.2s infinite; }
.loading__dot:nth-child(3) { animation: pulse 1.2s ease-in-out 0.4s infinite; }

.loading__text {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* ─── Results Header ─── */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.results-header__count {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
}

.results-header__refine {
    font-size: 12px;
    color: var(--accent);
    background: var(--accent-bg-light);
    border: 1px solid rgba(232,93,38,0.2);
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* ─── Sort Bar ─── */
.sort-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    padding: 4px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.sort-btn {
    flex: 1;
    padding: 8px 0;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #777;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.sort-btn--active {
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 600;
}

/* ─── Place Cards ─── */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 40px;
}

.place-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.place-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.place-card__main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.place-card__left {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.place-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
}

.place-card__icon--photo {
    background: none;
}

.place-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.place-card__info {
    flex: 1;
    min-width: 0;
}

.place-card__name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.place-card__address {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.place-card__meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.place-card__rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.place-card__star {
    color: #fbbf24;
    font-size: 14px;
}

.place-card__rating-value {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.place-card__review-count {
    font-size: 12px;
    color: var(--text-muted);
}

.place-card__price {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.place-card__price--cheap {
    color: var(--price-cheap);
    background: rgba(34,197,94,0.08);
}

.place-card__price--moderate {
    color: var(--price-moderate);
    background: rgba(245,158,11,0.08);
}

.place-card__price--upscale {
    color: var(--price-upscale);
    background: rgba(249,115,22,0.08);
}

.place-card__price--fine {
    color: var(--price-fine);
    background: rgba(239,68,68,0.08);
}

.place-card__distance {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #777;
}

.place-card__chevron {
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.place-card__chevron--expanded {
    transform: rotate(180deg);
}

/* ─── Place Card Expanded ─── */
.place-card__expanded {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    animation: fadeIn 0.2s ease;
}

.place-card__photo-full {
    margin-bottom: 12px;
    border-radius: 10px;
    overflow: hidden;
}

.place-card__photo-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.place-card__specialty {
    font-family: var(--font-body);
    font-size: 13px;
    color: #bbb;
    margin-bottom: 10px;
}

.place-card__specialty-label {
    color: var(--accent);
    font-weight: 500;
}

.place-card__actions {
    display: flex;
    gap: 8px;
}

.place-card__action-btn {
    font-family: var(--font-body);
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.place-card__action-btn--maps {
    border: 1px solid rgba(232,93,38,0.4);
    background: rgba(232,93,38,0.1);
    color: var(--accent);
}


/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state__emoji {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state__title {
    font-size: 15px;
    margin-bottom: 8px;
}

.empty-state__text {
    font-size: 12px;
    color: var(--text-dim);
}

/* ─── Fallback Notice ─── */
.fallback-notice {
    text-align: center;
    padding: 10px 16px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: rgba(250,204,21,0.08);
    border: 1px solid rgba(250,204,21,0.15);
    font-size: 12px;
    color: #ccc;
}
