:root {
    --gold: #D9AD38;
    --gold-dim: rgba(217, 173, 56, 0.3);
    --gold-bg: rgba(217, 173, 56, 0.15);
    
    --green-dark: #00E666;
    --green-light: #008C38;
    --radar-green: var(--green-dark);
    --green-bg: rgba(0, 230, 102, 0.1);
    
    --bg-dark: #000000;
    --bg-surface-dark: #0D0D0D;
    --bg-card-dark: #141414;
    --text-primary-dark: #FFFFFF;
    --text-secondary-dark: #8E8E93;
    
    --bg-light: #F2F2F7;
    --bg-surface-light: #FFFFFF;
    --bg-card-light: #FFFFFF;
    --text-primary-light: #000000;
    --text-secondary-light: #6C6C70;
    
    --app-bg: var(--bg-dark);
    --surface-bg: var(--bg-surface-dark);
    --card-bg: var(--bg-card-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    
    --tabbar-height: 56px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body.theme-light {
    --radar-green: var(--green-light);
    --green-bg: rgba(0, 140, 56, 0.1);
    --app-bg: var(--bg-light);
    --surface-bg: var(--bg-surface-light);
    --card-bg: var(--bg-card-light);
    --text-primary: var(--text-primary-light);
    --text-secondary: var(--text-secondary-light);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--app-bg);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.ios-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    position: relative;
    overflow: hidden;
    background-color: var(--app-bg);
}

/* ==========================================================
   VIEW NAVIGATION & VIEWS
   ========================================================== */
.ios-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - var(--tabbar-height) - var(--safe-bottom));
    display: none;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.ios-view.active {
    display: flex;
}

/* ==========================================================
   VIEW 1: RADAR SCAN VIEW (SwiftUI Exact Match)
   ========================================================== */
.ios-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--safe-top) + 12px) 16px 6px;
    flex-shrink: 0;
}

.title-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 26px;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.status-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--radar-green);
    letter-spacing: 0.5px;
}

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

/* 40x40 Circular SwiftUI buttons (Lines 89-160) */
.circle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--radar-green);
    background: var(--green-bg);
    color: var(--radar-green);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.circle-btn:active {
    transform: scale(0.92);
}

.circle-btn.theme-btn {
    border-color: #FFA500;
    background: rgba(255, 165, 0, 0.1);
    color: #FFA500;
}

.circle-btn.sound-btn.muted {
    border-color: #8E8E93;
    background: rgba(142, 142, 147, 0.1);
    color: #8E8E93;
}

/* Range Slider Control (Lines 166-188) */
.range-control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 16px 8px;
    flex-shrink: 0;
}

.range-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--radar-green);
}

.ios-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--radar-green);
    outline: none;
}

.ios-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.range-value-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--radar-green);
    width: 70px;
    text-align: right;
}

/* Radar Canvas & HUD (Lines 192-395) */
.radar-display-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: auto auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 360px;
}

/* HUD Metric Boxes (95x56px) */
.hud-box {
    position: absolute;
    top: 5px;
    width: 95px;
    height: 56px;
    padding: 4px 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 230, 102, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

body.theme-light .hud-box {
    background: rgba(255, 255, 255, 0.95);
}

.hud-left { left: 16px; }
.hud-right { right: 16px; }

.hud-tag {
    font-size: 9px;
    font-weight: 700;
    color: rgba(0, 230, 102, 0.7);
    line-height: 1.1;
    font-family: -apple-system, sans-serif;
}

.hud-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 900;
    color: var(--radar-green);
    margin-top: 1px;
}

.radar-canvas-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 50%;
}

#radar-canvas {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    display: block;
}

.radar-bottom-prompt {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    padding: 12px 16px 20px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

/* ==========================================================
   VIEW 2: MAP VIEW
   ========================================================== */
.map-surface {
    width: 100%;
    height: 100%;
    background: #0D0D0D;
}

.leaflet-tile {
    filter: brightness(0.65) invert(1) contrast(1.3) hue-rotate(180deg) saturate(0.3);
}

body.theme-light .leaflet-tile {
    filter: none;
}

/* Floating White Circle Location Button (MapView.swift Lines 118-155) */
.map-locate-btn {
    position: absolute;
    bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 20px);
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #FFFFFF;
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 500;
    transition: transform 0.15s ease;
}

.map-locate-btn:active {
    transform: scale(0.92);
}

/* Custom Vector Marker Pin */
.leaflet-custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.marker-pulse-ring {
    position: absolute;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid var(--radar-green);
    box-shadow: 0 0 8px var(--radar-green);
    pointer-events: none;
    animation: markerPulse 1.2s infinite;
}

@keyframes markerPulse {
    0% { transform: scale(0.9); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.5; }
    100% { transform: scale(0.9); opacity: 1; }
}

/* ==========================================================
   VIEW 3: SEARCH VIEW
   ========================================================== */
.search-top-header {
    background: var(--surface-bg);
    padding: calc(var(--safe-top) + 12px) 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.search-field-wrapper {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1.5px solid rgba(0, 230, 102, 0.4);
    border-radius: 12px;
    padding: 0 12px;
    height: 46px;
}

.search-leading-icon {
    color: var(--radar-green);
    font-size: 15px;
    margin-right: 10px;
}

.search-input-element {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.search-input-element::placeholder {
    color: #8E8E93;
}

.search-clear-icon {
    background: none;
    border: none;
    color: #8E8E93;
    font-size: 16px;
    cursor: pointer;
}

.search-scroll-list {
    flex: 1;
    padding: 14px 16px calc(var(--tabbar-height) + var(--safe-bottom) + 16px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-loading-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 40px 0;
}

/* ==========================================================
   OUTLET DETAIL CARD (Exact 1:1 replica of OutletDetailCard.swift)
   ========================================================== */
.outlet-detail-card {
    position: absolute;
    bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 8px);
    left: 14px;
    right: 14px;
    background: var(--card-bg);
    border-radius: 15px;
    border: 1.5px solid var(--gold-dim);
    padding: 16px;
    z-index: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    animation: slideCardUp 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes slideCardUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.card-close-xmark {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #8E8E93;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
}

.card-inner-layout {
    display: flex;
    gap: 12px;
}

/* Left Column: 70x70 Photo + Feedback Button */
.card-left-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.thumb-box {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(142, 142, 147, 0.12);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Orange Feedback Button (Lines 100-114) */
.feedback-orange-btn {
    width: 70px;
    padding: 3.5px 0;
    background: #FF9500;
    border: none;
    border-radius: 4px;
    color: #FFFFFF;
    font-size: 7px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.feedback-orange-btn:active {
    background: #E08500;
}

/* Right Column: Title, Address, unified Gold line, Badges, Google Maps button */
.card-right-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.marquee-box {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.card-address {
    font-size: 11px;
    color: #8E8E93;
}

.card-info-gold {
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
}

.card-hours-gray {
    font-size: 9px;
    font-weight: 700;
    color: #8E8E93;
}

.badges-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}

.tag-warning {
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
}

.tag-warning.red { color: #FF3B30; }
.tag-warning.yellow { color: #FFCC00; }
.tag-warning.orange { color: #FF9500; }

.tag-badge-gold {
    font-size: 9px;
    font-weight: 700;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-price-green {
    font-size: 9px;
    font-weight: 700;
    color: #34C759;
}

/* Google Maps Button (Lines 245-260) */
.card-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.google-maps-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--gold);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.google-maps-btn:hover, .google-maps-btn:active {
    background: #C49B2F;
}

/* ==========================================================
   ZOOMED PHOTO POPUP
   ========================================================== */
.zoomed-photo-container {
    position: absolute;
    bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 160px);
    left: 16px;
    right: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: #000000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    z-index: 700;
}

.zoomed-photo-element {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.zoomed-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 26px;
    cursor: pointer;
}

/* ==========================================================
   BOTTOM TAB BAR (MainView.swift Exact Match)
   ========================================================== */
.ios-tabbar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--tabbar-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: #0D0D0D;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 800;
}

body.theme-light .ios-tabbar {
    background: #FFFFFF;
    border-top-color: rgba(0, 0, 0, 0.1);
}

.ios-tab-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #8E8E93;
    flex: 1;
    height: 100%;
    cursor: pointer;
    transition: color 0.15s ease;
}

.tab-icon {
    font-size: 18px;
}

.tab-label {
    font-size: 10px;
    font-weight: 500;
}

.ios-tab-btn.active {
    color: var(--gold);
}

/* ==========================================================
   ABOUT VIEW MODAL (AboutView.swift)
   ========================================================== */
.modal-dim-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.about-sheet-card {
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    background: var(--surface-bg);
    border-radius: 16px;
    border: 1px solid rgba(0, 230, 102, 0.2);
    overflow-y: auto;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.about-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 26px;
    font-weight: 900;
    color: var(--gold);
}

.about-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.about-scroll-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about-section-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(0, 230, 102, 0.15);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--radar-green);
}

.section-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.about-button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.about-btn {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.about-btn.contact-btn {
    background: var(--radar-green);
    color: #000000;
}

.about-btn.done-btn {
    background: rgba(142, 142, 147, 0.2);
    color: var(--text-primary);
}

/* ==========================================================
   FEEDBACK SHEET MODAL (FeedbackSheet.swift)
   ========================================================== */
.feedback-sheet-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
}

.feedback-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.feedback-sheet-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
}

.fb-close-btn {
    background: none;
    border: none;
    color: #8E8E93;
    font-size: 22px;
    cursor: pointer;
}

.fb-venue-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.fb-options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.fb-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
}

.ios-checkbox {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
}

.fb-input-section {
    margin-bottom: 12px;
}

.fb-field-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.fb-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fb-curr-label {
    font-weight: 700;
    color: var(--gold);
}

.fb-price-field, .fb-textarea-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}

.fb-btn-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.fb-action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
}

.fb-action-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #8E8E93;
}

.fb-action-btn.submit {
    background: var(--gold);
    color: #000000;
}

.hide { display: none !important; }
