/* 
 * GoPrice - Main Application Styles
 * Extracted from index.html for better maintainability
 * Last Updated: April 2026
 */

/* ─── Design Tokens ─── */
:root { 
    --color-pink-primary: #FF8E9E;
    --color-pink-secondary: #FFB7C5;
    --color-pink-light: #FFF5F6;
    --color-blue-primary: #3B82F6;
    --color-blue-secondary: #93C5FD;
    --color-blue-light: #E0F2FE;
    --color-gold: #D4AF37;
    --color-bg: #FFF5F6;
    --color-text-primary: #1F2937;
    --color-text-secondary: #6B7280;
    --color-text-muted: #9CA3AF;

    --radius-sm: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-2xl: 2.5rem;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-pink: 0 8px 20px rgba(255, 142, 158, 0.3);
    --shadow-blue: 0 8px 20px rgba(59, 130, 246, 0.3);

    --gradient-pink: linear-gradient(135deg, #FFB7C5 0%, #FF8E9E 100%);
    --gradient-pink-hover: linear-gradient(135deg, #FF8E9E 0%, #FF6B8B 100%);
    --gradient-blue: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    --gradient-gold: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);

    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

    /* Legacy aliases */
    --jp-pink: var(--color-pink-primary);
    --jp-sakura: var(--color-pink-secondary);
    --jp-gold: var(--color-gold);
    --bg-soft: var(--color-bg);
}

/* ─── Base Reset ─── */
html, body {
    overscroll-behavior-y: none;
}

body { 
    font-family: 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans KR', sans-serif; 
    background: var(--color-bg); 
    color: var(--color-text-primary);
    margin: 0; 
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Allow text selection only in input fields */
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* Prevent image dragging */
img {
    -webkit-user-drag: none;
    pointer-events: none;
}

/* ─── Scrollbar ─── */
.no-scrollbar::-webkit-scrollbar { 
    display: none; 
}

/* ─── App Shell ─── */
.app-shell { 
    max-width: 600px; 
    margin: 0 auto; 
    background: #fff; 
    min-height: 100vh; 
    position: relative; 
    box-shadow: 0 0 60px rgba(255, 142, 158, 0.08); 
}

/* ─── Card Components ─── */
/* Base styles defined in index.html <style type="text/tailwindcss"> via @apply */

/* ─── Button Styles ─── */
.btn-sakura {
    background: var(--gradient-pink);
    box-shadow: var(--shadow-pink);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.btn-sakura:hover {
    background: var(--gradient-pink-hover);
    box-shadow: 0 10px 25px rgba(255, 142, 158, 0.4);
    transform: translateY(-1px);
}

.btn-disabled { 
    background: #E5E7EB !important; 
    color: #9CA3AF !important; 
    cursor: pointer !important; 
    box-shadow: none !important; 
} 

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
}

.btn-loading > span[data-i18n] {
    visibility: hidden;
}

.btn-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Form Components ─── */
/* Base styles defined in index.html <style type="text/tailwindcss"> via @apply */

.input-field.error {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
}

.input-field.error:focus {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* checkbox-custom base defined in index.html via @apply */

.error-message {
    color: #EF4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.error-message::before {
    content: "\26A0";
    font-size: 0.75rem;
}

.label-error {
    color: #EF4444 !important;
}

.gender-btn.error {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
    color: #DC2626 !important;
}

.checkbox-custom.error {
    border-color: #EF4444 !important;
}

/* ─── Category / Mode Panels ─── */
/* Base styles defined in index.html <style type="text/tailwindcss"> via @apply */
/* Additional pure-CSS overrides below: */

.cat-panel { 
    transition: all 0.2s var(--ease-spring);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    background: white;
    min-height: 48px;
}

.cat-panel:active { 
    transform: scale(0.95);
}

.cat-panel.active { 
    border-color: var(--color-pink-primary);
    transform: scale(1.03);
    border-width: 1.5px;
    background: var(--gradient-pink);
    box-shadow: 0 4px 15px rgba(255, 142, 158, 0.15);
    z-index: 10;
}

.cat-panel.active[data-mode="community"] { 
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

.cat-panel.active[data-mode="personal"] { 
    background: var(--gradient-pink);
    box-shadow: 0 4px 15px rgba(255, 142, 158, 0.15);
}

.cat-panel i { 
    height: 18px; 
}

.cat-panel span { 
    line-height: 1;
}

/* ─── Sort Buttons ─── */
/* Base styles defined in index.html <style type="text/tailwindcss"> via @apply */

/* ─── Radius / Distance Buttons ─── */
/* Base styles defined in index.html <style type="text/tailwindcss"> via @apply */

.radius-btn.active i, .radius-btn.active svg { 
    color: var(--color-pink-primary) !important;
    stroke: var(--color-pink-primary) !important; 
}

/* ─── Top 10 Snap Items ─── */
/* Base styles defined in index.html <style type="text/tailwindcss"> via @apply */

.snap-item:hover {
    box-shadow: var(--shadow-md);
}

/* rank-indicator and rank-num base defined in index.html via @apply */

.rank-num { 
    font-family: 'Georgia', serif; 
}

/* ─── Rank Badges ─── */
/* Base rank-indicator and rank-num defined in index.html via @apply */
.rank-1 { 
    color: var(--color-gold);
    background: var(--gradient-gold) !important;
    border-color: #FFD700 !important;
}

.rank-1 .rank-num {
    color: #8B4513 !important;
}

.rank-2 { 
    color: #696969;
    background: linear-gradient(135deg, #C0C0C0 0%, #A9A9A9 100%) !important;
    border-color: #C0C0C0 !important;
}

.rank-2 .rank-num {
    color: #696969 !important;
}

.rank-3 { 
    color: #FFF8DC;
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%) !important;
    border-color: #CD7F32 !important;
}

.rank-3 .rank-num {
    color: #FFF8DC !important;
}

.rank-default { 
    color: white;
    background: var(--gradient-pink) !important;
    border-color: var(--color-pink-primary) !important;
}

.rank-default .rank-num {
    color: white !important;
}

.rank-default-community { 
    color: var(--color-blue-primary);
}

/* ─── Pulse Animations ─── */
.pulse-sakura { 
    animation: pulse-pink 2s infinite; 
    border-color: var(--color-pink-primary) !important;
}

@keyframes pulse-pink {
    0% { box-shadow: 0 0 0 0 rgba(255, 142, 158, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(255, 142, 158, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 142, 158, 0); }
}

.pulse-blue { 
    animation: pulse-blue 2s infinite; 
}

@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.pulse-sparkle { 
    animation: pulse-sparkle 3s infinite; 
}

@keyframes pulse-sparkle {
    0% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); color: #FF4D6D; }
    100% { opacity: 0.7; transform: scale(1); }
}

.pulse-text { 
    animation: pulse-text 3s infinite; 
}

@keyframes pulse-text {
    0% { color: #6B7280; }
    50% { color: #FF4D6D; }
    100% { color: #6B7280; }
}

/* ─── Countdown Bar ─── */
.countdown-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--color-pink-primary) 0%, var(--color-pink-secondary) 100%);
    transition: width 1s linear;
    border-radius: 2px;
}

/* ─── Language Select ─── */
.lang-select { 
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23FF69B4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    min-width: 140px;
}

/* ─── Personal Filter Toggle ─── */
.personal-filter-dropdown {
    min-width: 140px;
}

 .personal-filter-toggle {
     position: relative;
     display: flex;
     align-items: center;
     background-color: rgba(252, 231, 243, 0.7);
     border-radius: var(--radius-md);
     border: 1px solid rgba(254, 205, 211, 0.8);
     padding: 0.25rem;
     min-width: 160px;
 }

#personal-filter-slider {
    position: absolute;
    top: 0.25rem;
    bottom: 0.25rem;
    left: 0;
    width: 50%;
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xs);
    transition: transform 0.3s ease-in-out;
    z-index: 1;
}

 .personal-filter-toggle button {
     flex: 1;
     position: relative;
     z-index: 10;
     padding: 0.4rem 0.6rem;
     text-align: center;
     background: none;
     border: none;
     cursor: pointer;
     transition: all 0.2s;
 }

 .personal-filter-toggle button span {
     font-size: 0.7rem;
     font-weight: 700;
     transition: color 0.2s;
 }

/* ─── Distance Slider ─── */
.distance-slider-container {
    width: 100%;
}

.distance-track {
    width: 100%;
}

.distance-marker {
    box-shadow: var(--shadow-sm);
    z-index: 6;
}

.distance-marker.active {
    box-shadow: 0 4px 12px rgba(255, 142, 158, 0.4);
    transform: translateX(-50%) translateY(-50%) scale(1.15);
}

.distance-marker:first-of-type .distance-marker-label {
    left: 0;
    transform: none;
}
.distance-marker:last-of-type .distance-marker-label {
    left: 100%;
    transform: translateX(-100%);
}

.distance-dragger {
    z-index: 10;
}

.distance-dragger-line {
    z-index: 5;
}

/* ─── OSM Preview ─── */
#osm-preview {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 60px;
}

@media (max-width: 400px) {
    #osm-preview {
        height: 50px;
    }
}

@media (max-width: 500px) {
    .header-app-name {
        display: none;
    }
}

/* ─── Map Styles ─── */
#edit-map {
    width: 100%;
    height: 100%;
    z-index: 1;
    position: relative;
    min-height: 400px;
    touch-action: pan-x pan-y;
    -webkit-tap-highlight-color: transparent;
}

#edit-map .leaflet-container {
    width: 100%;
    height: 100%;
    font-family: inherit;
    min-height: 400px;
}

#results-map {
    position: relative;
    z-index: 1;
    height: 100%;
    min-height: 300px;
    max-height: 100%;
    overflow: hidden;
}

#results-map .leaflet-container {
    width: 100%;
    height: 100%;
    font-family: inherit;
    min-height: 300px;
}

#edit-map .leaflet-control-container .leaflet-control {
    z-index: 1000;
}

.user-marker, .store-marker-active, .store-marker-inactive {
    background: transparent;
    border: none;
}

.custom-pin-marker {
    cursor: pointer !important;
}

/* ─── Drawer ─── */
.drawer { 
    transform: translateY(100%); 
    transition: transform var(--duration-slow) cubic-bezier(0.32, 0.72, 0, 1); 
    visibility: hidden; 
}

.drawer-open { 
    transform: translateY(0) !important; 
    visibility: visible !important; 
}

/* ─── Product Detail Drawer ─── */
#product-detail {
    box-sizing: border-box;
}

#product-detail.drawer-open {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@supports (padding: max(0px, env(safe-area-inset-top, 0px))) {
    #product-detail.drawer-open {
        max-height: calc(90vh - env(safe-area-inset-top, 0px));
        padding-top: env(safe-area-inset-top, 0px) !important;
    }
}

#product-detail .image-wrapper {
    width: 100%;
    height: 12rem;
    background: #f9fafb;
    position: relative;
    border-radius: var(--radius-md);
}

#product-detail .price-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

#product-detail .price-box.community {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.12) 100%);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

#detail-badge {
    cursor: default;
    transition: opacity var(--duration-fast);
}
#detail-badge[style*="cursor: pointer"] {
    cursor: pointer;
}
#detail-badge:active {
    opacity: 0.7;
}

.price-graph-container {
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    padding-left: 0.75rem;
}

.price-sparkline {
    overflow: visible;
}

.price-sparkline .sparkline-line {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.price-sparkline .sparkline-area {
    fill: url(#sparkline-gradient);
    opacity: 0.3;
}

.price-sparkline .sparkline-dot {
    fill: #3b82f6;
    stroke: white;
    stroke-width: 1.5;
}

.price-sparkline .sparkline-dot-first {
    fill: #9ca3af;
    stroke: white;
    stroke-width: 1;
}

.price-graph-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 100%;
}

#detail-confirm-count {
    font-size: 1.125rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 2px;
    color: #60a5fa;
}

#detail-confirm-text {
    font-size: 0.625rem;
    font-weight: 500;
    color: #60a5fa;
}

#detail-badge.text-pink-400 #detail-confirm-count,
#detail-badge.text-pink-400 #detail-confirm-text {
    color: #f472b6;
}

#product-detail .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
}

#product-detail .btn-tap:active { 
    transform: scale(0.96); 
    transition: transform var(--duration-fast); 
}

/* ─── Product Detail Timestamp ─── */
#detail-timestamp {
    transition: opacity 0.3s ease;
}

#detail-time-ago {
    letter-spacing: 0.05em;
}

#detail-exact-time {
    letter-spacing: 0.03em;
    opacity: 0.7;
}

.bg-pink-50\/50 #detail-timestamp {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 183, 197, 0.3);
}

.bg-pink-50\/50 #detail-time-ago {
    color: #9ca3af;
    font-weight: 500;
}

.bg-pink-50\/50 #detail-exact-time {
    color: #d1d5db;
    font-weight: 400;
}

/* ─── Product Detail Buttons ─── */
#product-detail .flex.items-center.justify-between.gap-4 button:first-child {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border-color: #e2e8f0;
    color: #64748b;
    font-weight: 700;
}

#product-detail .flex.items-center.justify-between.gap-4 button:first-child:hover {
    background: linear-gradient(to right, #f1f5f9, #e2e8f0);
    border-color: #cbd5e1;
    color: #475569;
}

#product-detail .flex.items-center.justify-between.gap-4 button:last-child {
    background: linear-gradient(to right, var(--color-pink-primary), #ff6b8b);
    border: none;
    font-weight: 700;
}

#product-detail .flex.items-center.justify-between.gap-4 button:last-child:hover {
    background: linear-gradient(to right, #ff6b8b, #ff477e);
    box-shadow: 0 4px 12px rgba(255, 107, 139, 0.3);
}

/* ─── Community Mode Theme ─── */
.product-confirmed {
    border-color: #60A5FA !important;
    background: white !important;
}

.product-confirmed .product-price {
    color: var(--color-blue-primary) !important;
}

.mode-community .card-soft,
body.mode-community .card-soft {
    border-color: #E0F2FE !important;
}

.mode-community .btn-sakura,
body.mode-community .btn-sakura {
    background: var(--gradient-blue) !important;
    box-shadow: var(--shadow-blue) !important;
}

/* Camera button stays pink in both modes */
#auth-overlay .btn-sakura {
    background: var(--gradient-pink) !important;
    box-shadow: var(--shadow-pink) !important;
}

#guide-overlay .btn-sakura,
#review-overlay .btn-sakura,
#edit-overlay .btn-sakura,
#success-interstitial .btn-sakura {
    background: var(--gradient-pink) !important;
    box-shadow: var(--shadow-pink) !important;
}

#camera-button.btn-sakura,
body #camera-button.btn-sakura,
body.mode-community #camera-button.btn-sakura,
.mode-community #camera-button.btn-sakura {
    background: var(--gradient-pink) !important;
    box-shadow: var(--shadow-pink) !important;
    border-color: var(--color-pink-primary) !important;
}

#camera-button.btn-sakura.pulse-sakura {
    border-color: var(--color-pink-primary) !important;
    animation: pulse-pink 2s infinite !important;
}

#share-button,
body #share-button,
body.mode-community #share-button,
.mode-community #share-button {
    background: var(--gradient-pink) !important;
    box-shadow: var(--shadow-pink) !important;
    border-color: var(--color-pink-primary) !important;
}

#share-button:hover {
    background: var(--gradient-pink-hover) !important;
}

.mode-community .pulse-sakura,
body.mode-community .pulse-sakura {
    border-color: var(--color-blue-primary) !important;
    animation: pulse-blue 2s infinite !important;
}

.mode-community .radius-btn.active,
body.mode-community .radius-btn.active {
    border-color: var(--color-blue-primary) !important;
    color: var(--color-blue-primary) !important;
    background-color: var(--color-blue-light) !important;
}

.mode-community .radius-btn.active i,
.mode-community .radius-btn.active svg,
body.mode-community .radius-btn.active i,
body.mode-community .radius-btn.active svg {
    color: var(--color-blue-primary) !important;
    stroke: var(--color-blue-primary) !important;
}

.mode-community .sort-btn.active,
body.mode-community .sort-btn.active {
    background-color: var(--color-blue-light) !important;
    color: var(--color-blue-primary) !important;
    border-color: var(--color-blue-secondary) !important;
}

.mode-community .cat-panel.active,
body.mode-community .cat-panel.active {
    border-color: var(--color-blue-primary) !important;
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15) !important;
}

.mode-community .cat-panel.active i,
body.mode-community .cat-panel.active i {
    color: var(--color-blue-primary) !important;
}

.mode-community .cat-panel.active span,
body.mode-community .cat-panel.active span {
    color: var(--color-blue-primary) !important;
}

/* Mode-specific visibility */
.mode-community .mode-community-only {
    display: flex !important;
}
.mode-community .mode-personal-only {
    display: none !important;
}

body:not(.mode-community) .mode-community-only {
    display: none !important;
}
body:not(.mode-community) .mode-personal-only {
    display: flex !important;
}

/* ─── Overlay Lock ─── */
.hidden { 
    display: none !important; 
}

body.overlay-open {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    touch-action: none;
}

body.overlay-open main {
    overflow: hidden;
    pointer-events: none;
}

body.overlay-open #product-detail,
body.overlay-open #drawer-overlay,
body.overlay-open #fullscreen-image-overlay,
body.overlay-open #guide-overlay,
body.overlay-open #scan-anim,
body.overlay-open #camera-overlay,
body.overlay-open #review-overlay,
body.overlay-open #edit-overlay,
body.overlay-open #auth-overlay {
    pointer-events: auto;
    touch-action: auto;
}

/* ─── Drawer Overlay ─── */
#drawer-overlay {
    transition: opacity 0.3s ease;
}

/* ─── Fullscreen Image Viewer ─── */
#fullscreen-image-overlay {
    transition: opacity 0.3s ease;
    cursor: pointer;
}

#fullscreen-image-overlay:not(.hidden) {
    animation: fadeIn 0.3s ease;
}

#fullscreen-image-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#fullscreen-image {
    transition: opacity 0.3s ease;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: pointer;
}

#fullscreen-image:not(.hidden) {
    animation: zoomIn 0.3s ease;
}

#fullscreen-image-loading {
    transition: opacity 0.3s ease;
    background: black;
}

/* ─── Image Loading States ─── */
.img-skeleton {
    background: linear-gradient(110deg, #fce4ec 30%, #f8bbd0 50%, #fce4ec 70%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.img-thumb {
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

.img-thumb.loaded {
    opacity: 1;
}

.detail-skeleton-bar {
    background: linear-gradient(110deg, #f3f4f6 30%, #e5e7eb 50%, #f3f4f6 70%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

.detail-skeleton-bar-pink {
    background: linear-gradient(110deg, #fce4ec 30%, #f8bbd0 50%, #fce4ec 70%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Profile Skeletons ─── */
.profile-skeleton-name {
    background: linear-gradient(110deg, #f3f4f6 30%, #e5e7eb 50%, #f3f4f6 70%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
    width: 120px;
    height: 24px;
    margin: 0 auto;
}

.profile-skeleton-badge {
    background: linear-gradient(110deg, #fce4ec 30%, #f8bbd0 50%, #fce4ec 70%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 9999px;
    width: 60px;
    height: 20px;
}

.profile-skeleton-points {
    background: linear-gradient(110deg, #fce4ec 30%, #f8bbd0 50%, #fce4ec 70%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
    width: 80px;
    height: 20px;
    margin: 0 auto;
}

.profile-skeleton-stat {
    background: linear-gradient(110deg, #f3f4f6 30%, #e5e7eb 50%, #f3f4f6 70%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
    width: 40px;
    height: 24px;
    margin: 0 auto 4px;
}

.profile-skeleton-label {
    background: linear-gradient(110deg, #f3f4f6 30%, #e5e7eb 50%, #f3f4f6 70%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 0.25rem;
    width: 60px;
    height: 10px;
    margin: 0 auto;
}

/* ─── Location Grouping ─── */
.location-group {
    transition: all 0.3s ease;
}

.location-group:hover {
    box-shadow: 0 4px 12px rgba(255, 142, 158, 0.15);
}

.location-header {
    transition: background-color 0.2s ease;
}

.location-header:hover {
    background-color: rgba(255, 183, 197, 0.1);
}

.location-items {
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.location-items.hidden {
    max-height: 0;
    overflow: hidden;
}

.location-items::-webkit-scrollbar {
    width: 4px;
}

.location-items::-webkit-scrollbar-track {
    background: rgba(255, 183, 197, 0.1);
    border-radius: 2px;
}

.location-items::-webkit-scrollbar-thumb {
    background: rgba(255, 142, 158, 0.3);
    border-radius: 2px;
}

.location-items::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 142, 158, 0.5);
}

/* ─── Touch Feedback ─── */
#detail-img-box {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
}

#detail-img-box:active {
    opacity: 0.9;
}

#search-clear {
    transition: opacity var(--duration-fast), transform var(--duration-fast);
}

#search-clear:active {
    transform: translateY(-50%) scale(0.9);
}

/* ─── Keyframe Animations ─── */
@keyframes scan { 
    0% { top: 0; } 
    100% { top: 100%; } 
}

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

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.95);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slide-up-fade {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float-petal {
    0% {
        transform: translateY(0) rotate(45deg) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) rotate(45deg) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotate(45deg) scale(1);
        opacity: 0.7;
    }
}

@keyframes card-entrance {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes heart-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes points-count {
    0% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes bounce-in {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ─── Sakura Petal ─── */
.sakura-petal {
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--gradient-pink);
    border-radius: 50% 50% 50% 0;
    transform: rotate(45deg);
    opacity: 0.7;
    animation: float-petal 4s ease-in-out infinite;
}

/* ─── Success Interstitial ─── */
#success-interstitial {
    animation: slide-up-fade 0.5s ease-out;
}

/* ─── Animations Utility Classes ─── */
.anim-card-entrance {
    animation: card-entrance 0.4s var(--ease-out-expo) both;
}

.anim-heart-pop {
    animation: heart-pop 0.4s var(--ease-spring) both;
}

.anim-bounce-in {
    animation: bounce-in 0.6s var(--ease-spring) both;
}

.anim-shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ─── Confetti Particles ─── */
.confetti-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confetti-fall 2s ease-in forwards;
    z-index: 2001;
    pointer-events: none;
}

/* ─── Product Tooltip ─── */
.product-tooltip {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.product-tooltip > div {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-tooltip:hover {
    opacity: 0.9;
}

/* ─── Safe Area ─── */
.safe-area-top {
    padding-top: env(safe-area-inset-top, 0px);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.safe-area-left {
    padding-left: env(safe-area-inset-left, 0px);
}

.safe-area-right {
    padding-right: env(safe-area-inset-right, 0px);
}

/* ─── Map View Layout ─── */
#map-view-btn {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#view-map {
    position: relative;
    z-index: auto;
    height: 100%;
    overflow: hidden;
    flex: 1;
    padding-bottom: 112px;
    box-sizing: border-box;
}

/* ─── Auth Overlay Scroll ─── */
#auth-overlay {
    -webkit-overflow-scrolling: touch;
}

#step-email, #step-code, #step-register {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ─── Mobile Touch Targets ─── */
@media (max-width: 768px) {
    .store-card {
        min-width: 180px !important;
    }
    
    button, .btn-sakura, .radius-btn, .cat-panel {
        min-height: 44px;
    }
    
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* ─── Extra Small Screens (iPhone SE) ─── */
@media (max-width: 375px) {
    .sort-btn {
        padding: 0.25rem 0.5rem;
    }

    .personal-filter-toggle {
        min-width: 140px;
    }

    .personal-filter-toggle button span {
        font-size: 0.65rem;
    }

    #auth-overlay .p-8 {
        padding: 1.5rem;
    }
    
    #auth-overlay h1 {
        font-size: 1.5rem;
    }
    
    .input-field {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.875rem;
        padding-bottom: 0.875rem;
        font-size: 0.875rem;
    }
    
    button.py-4 {
        padding-top: 0.875rem;
        padding-bottom: 0.875rem;
    }
    
    #review-overlay .max-w-\[85\%\] {
        max-width: 95%;
    }
    
    #edit-overlay button.py-3 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    #edit-overlay .grid {
        gap: 0.5rem;
    }
    
    #success-interstitial .w-48 {
        width: 8rem;
        height: 8rem;
    }
    
    #success-interstitial .text-3xl {
        font-size: 1.75rem;
    }
    
    #success-interstitial .text-lg {
        font-size: 1rem;
    }
    
    #scan-anim .px-12 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #scan-anim .rounded-\[3rem\] {
        border-radius: 1.5rem;
    }
    
    .gender-btn {
        font-size: 0.75rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    #auth-overlay {
        max-height: 100vh;
    }
    
    #step-email, #step-code, #step-register {
        max-height: calc(100vh - 120px);
    }
    
    .input-field {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        font-size: 0.875rem;
    }
    
    button.py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    #camera-overlay .absolute.bottom-4 {
        bottom: 3rem !important;
    }
    
    #review-overlay .p-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-bottom: 4.5rem !important;
    }
    
    #review-overlay button,
    #edit-overlay button {
        font-size: 0.875rem !important;
    }
}

/* ─── Camera Overlay Responsive ─── */
@media (max-height: 700px) {
    #camera-overlay .flex-1 {
        min-height: calc(100vh - 180px);
    }
    
    #camera-overlay .h-28 {
        height: 100px;
    }
    
    #camera-overlay button[onclick="takePhoto()"] {
        width: 60px;
        height: 60px;
    }
    
    #camera-overlay .absolute.bottom-8 {
        bottom: 4rem !important;
    }
    
    #review-overlay .p-4 {
        padding-bottom: 5rem !important;
    }
    
    #view-map {
        padding-bottom: 80px;
    }
    #results-map {
        min-height: 250px;
    }
    #results-map .leaflet-container {
        min-height: 250px;
    }
}

@media (max-height: 600px) {
    #camera-overlay .flex-1 {
        min-height: calc(100vh - 140px);
    }
    
    #camera-overlay .h-28 {
        height: 80px;
    }
    
    #camera-overlay button[onclick="takePhoto()"] {
        width: 50px;
        height: 50px;
        border-width: 2px;
    }
    
    #camera-overlay .absolute.inset-0.flex {
        padding: 2rem;
    }
    
    #camera-overlay .absolute.bottom-8 {
        bottom: 3.5rem !important;
    }
    
    #review-overlay .p-4 {
        padding-bottom: 4.5rem !important;
    }
}

@media (max-height: 500px) {
    #camera-overlay .absolute.bottom-8 {
        bottom: 3rem !important;
    }
    
    #review-overlay .p-4 {
        padding-bottom: 4rem !important;
    }
    
    #review-overlay button,
    #edit-overlay button {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        font-size: 0.875rem !important;
    }
    
    #edit-overlay .flex-1 {
        padding-bottom: 1rem;
    }
    
    #edit-overlay .grid {
        margin-top: 1rem;
    }
}

@media (max-height: 650px) and (max-width: 375px) {
    #camera-overlay .absolute.bottom-4 {
        bottom: 2.5rem !important;
    }
    
    #review-overlay .p-4 {
        padding-bottom: 4rem !important;
    }
    
    #review-overlay button,
    #edit-overlay button {
        padding-top: 0.625rem !important;
        padding-bottom: 0.625rem !important;
    }
    
    #edit-overlay .flex-1 {
        padding-bottom: 0.5rem;
    }
    
    #edit-overlay .grid {
        margin-top: 0.5rem;
        gap: 0.5rem;
    }
}

/* ─── Safe Area Adjustments ─── */
#camera-overlay .h-32,
#review-overlay .p-4,
#edit-overlay .p-4,
#product-detail {
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}

#camera-overlay .absolute.bottom-8,
#review-overlay .p-4,
#edit-overlay .p-4 {
    margin-bottom: env(safe-area-inset-bottom, 0px) !important;
}

/* ─── Desktop / Tablet Enhancements ─── */
@media (min-width: 640px) {
    body {
        background: linear-gradient(180deg, #FFF5F6 0%, #fce4ec 30%, #FFF5F6 100%);
    }
    
    .app-shell {
        border-left: 1px solid rgba(255, 183, 197, 0.15);
        border-right: 1px solid rgba(255, 183, 197, 0.15);
    }
    
    .btn-sakura:hover {
        transform: translateY(-2px);
    }
    
    .card-soft:hover {
        box-shadow: var(--shadow-md);
    }
    
    .snap-item:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
    
    .cat-panel:hover {
        border-color: var(--color-pink-primary);
    }
    
    .sort-btn:hover {
        background-color: rgba(255, 142, 158, 0.08);
    }
    
    #nav-home:hover, #nav-profile:hover {
        color: var(--color-pink-primary) !important;
    }
    
    button:focus-visible,
    select:focus-visible,
    input:focus-visible {
        outline: 2px solid var(--color-pink-primary);
        outline-offset: 2px;
        border-radius: 8px;
    }
}

@media (min-width: 768px) {
    #view-home {
        padding-bottom: 8rem;
    }
    
    #view-profile {
        padding-bottom: 8rem;
    }
}

/* ─── View Transitions ─── */
.view-transition-enter {
    animation: view-slide-in 0.35s var(--ease-out-expo) both;
}

@keyframes view-slide-in {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}
