/* Seelo PWA - Dark Mode Only Styles */

/* ===== Design Tokens ===== */
:root {
    --color-bg: #0a0a0a;
    --color-surface: #141414;
    --color-surface-raised: #1c1c1e;
    --color-accent: #c8a2ff;
    --color-accent-muted: rgba(200, 162, 255, 0.15);
    --color-text: #f5f5f7;
    --color-text-secondary: rgba(245, 245, 247, 0.55);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-glass: rgba(20, 20, 20, 0.72);
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-pill: 100px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Bottom Dock ===== */
.bottom-dock {
    position: fixed;
    bottom: 20px;
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;

    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;

    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill);

    /* Entry animation */
    animation: dockSlideUp 0.6s var(--ease-out) 0.6s both;
}

.dock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.dock-btn:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.dock-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.12);
}

/* Center download button — slightly larger, accent treatment */
.dock-download {
    width: 46px;
    height: 46px;
    color: rgba(255, 255, 255, 0.75);
}

.dock-download:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Divider between dock items */
.dock-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

/* Tooltip on hover */
.dock-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s var(--ease-out);
}

.dock-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Hide dock during swipe drag */
.swipe-card.dragging ~ .bottom-dock,
body.swiping .bottom-dock {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
    pointer-events: none;
    transition: all 0.15s ease-out;
}

@keyframes dockSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Swipe Container */
#swipe-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    cursor: grab;
    background: var(--color-bg);
}

#swipe-container.dragging {
    cursor: grabbing;
}

/* Swipe Cards */
.swipe-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    
    /* GPU acceleration */
    will-change: transform, opacity;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    
    /* Touch optimization */
    touch-action: none;
    pointer-events: auto;
}

.swipe-card.active {
    z-index: 3;
}

.swipe-card.next {
    z-index: 2;
    transform: translate3d(0, 0, 0) scale(0.95);
    opacity: 0.8;
}

.swipe-card.preload {
    z-index: 1;
    transform: translate3d(0, 0, 0) scale(0.9);
    opacity: 0.6;
    pointer-events: none;
}

/* Card Image */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    
    /* Performance optimizations */
    will-change: transform;
    transform: translate3d(0, 0, 0);
    
    /* Prevent image drag */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    
    /* Smooth loading */
    transition: opacity 0.3s ease-out;
}

/* Blur Placeholder */
.blur-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px);
    transform: scale(1.1); /* Prevent blur edge artifacts */
    z-index: -1;
    
    /* Fade out when image loads */
    transition: opacity 0.5s ease-out;
}

.blur-placeholder.loaded {
    opacity: 0;
}

/* Swipe Indicators */
.swipe-indicator {
    position: absolute;
    top: 50%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    
    /* Initial hidden state */
    opacity: 0;
    transform: translate3d(0, -50%, 0) scale(0);
    
    /* Animation properties */
    will-change: transform, opacity;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Backdrop */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.swipe-indicator.like {
    right: 60px;
    background: rgba(34, 197, 94, 0.2);
    border: 2px solid #22c55e;
}

.swipe-indicator.dislike {
    left: 60px;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
}

.swipe-indicator.show {
    opacity: 0.9;
    transform: translate3d(0, -50%, 0) scale(1);
}

.swipe-indicator.animate-out {
    opacity: 0;
    transform: translate3d(0, -50%, 0) scale(1.2);
    transition: all 0.4s ease-out;
}

/* Download Button */
.download-button {
    position: absolute;
    bottom: 60px;
    right: 60px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 18px;
    
    /* Glassmorphism effect */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* Smooth interactions */
    cursor: pointer;
    transition: all 0.2s ease-out;
    
    /* GPU acceleration */
    will-change: transform, opacity;
    transform: translate3d(0, 0, 0);
    
    /* Touch optimization */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.download-button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translate3d(0, 0, 0) scale(1.05);
}

.download-button:active {
    transform: translate3d(0, 0, 0) scale(0.95);
}

.download-button.downloading {
    background: rgba(34, 197, 94, 0.6);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Hide download button on non-active cards */
.swipe-card:not(.active) .download-button {
    opacity: 0.3;
    pointer-events: none;
}

/* Daily Wallpaper Overlay */
.daily-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    transition: opacity 0.6s var(--ease-out);
}

.daily-overlay.loaded {
    opacity: 1;
}

.daily-content {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
    color: var(--color-text);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.daily-header h1 {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 6px;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.daily-subtitle {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 28px;
    letter-spacing: 0.02em;
}

.cached-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.2rem;
}

.date-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    background: var(--color-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.date-badge-month {
    display: block;
    color: var(--color-accent);
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.date-badge-day {
    display: block;
    color: var(--color-text);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1;
}

.daily-image-container {
    position: relative;
    max-width: 280px;
    max-height: 420px;
    margin: 0 auto 32px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--color-border);
}

.daily-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.daily-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.daily-overlay.loaded .daily-image {
    opacity: 1;
}

.daily-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    align-items: center;
    width: 100%;
    max-width: 280px;
}

.daily-action {
    padding: 14px 24px;
    border-radius: var(--radius-md);
    border: none;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    width: 100%;
    letter-spacing: 0.01em;

    -webkit-tap-highlight-color: transparent;
}

.daily-action.primary {
    background: var(--color-text);
    color: var(--color-bg);
    font-weight: 600;
}

.daily-action.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.12);
}

.daily-action.primary:active {
    transform: scale(0.97);
}

.daily-action.secondary {
    background: var(--color-surface-raised);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.daily-action.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.14);
}

.daily-action.tertiary {
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 13px;
    padding: 10px;
}

.daily-action.tertiary:hover {
    color: var(--color-text);
}

.daily-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--color-text-secondary);
    letter-spacing: 0.03em;
}

.daily-photographer {
    font-style: italic;
}

.daily-category {
    text-transform: uppercase;
    padding: 3px 8px;
    background: var(--color-accent-muted);
    color: var(--color-accent);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.08em;
}

/* Mobile responsiveness for daily overlay */
@media (max-width: 480px) {
    .daily-content {
        padding: 15px;
    }

    .daily-header h1 {
        font-size: 2rem;
    }

    .daily-image-container {
        max-width: 240px;
        max-height: 360px;
    }

    .daily-actions {
        max-width: 240px;
    }

    .daily-action {
        padding: 12px 20px;
        font-size: 13px;
    }
}

/* Card rotation and movement during drag */
.swipe-card.dragging {
    transition: none;
}

/* Spring animation for card return */
.swipe-card.returning {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Card exit animations */
.swipe-card.swiped-right {
    animation: swipeRight 0.3s ease-out forwards;
}

.swipe-card.swiped-left {
    animation: swipeLeft 0.3s ease-out forwards;
}

@keyframes swipeRight {
    to {
        transform: translate3d(100vw, -100px, 0) rotate(30deg);
        opacity: 0;
    }
}

@keyframes swipeLeft {
    to {
        transform: translate3d(-100vw, -100px, 0) rotate(-30deg);
        opacity: 0;
    }
}

/* Loading states */
.card-image.loading {
    opacity: 0;
}

.card-image.loaded {
    opacity: 1;
}

/* Error state */
.card-error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #111;
    color: #666;
    font-size: 16px;
    text-align: center;
    flex-direction: column;
}

.card-error .retry-button {
    margin-top: 20px;
    padding: 12px 24px;
    background: #333;
    border: 1px solid #666;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.card-error .retry-button:hover {
    background: #444;
}

/* Debug Info (Development) */
#debug-info {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    font-family: monospace;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.debug-item {
    margin: 4px 0;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Disable bounce scroll */
    body {
        position: fixed;
        overflow: hidden;
    }
    
    /* Prevent zoom on double tap */
    * {
        touch-action: manipulation;
    }
    
    .swipe-card {
        touch-action: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .swipe-indicator.like {
        border-color: #00ff00;
        background: rgba(0, 255, 0, 0.3);
    }
    
    .swipe-indicator.dislike {
        border-color: #ff0000;
        background: rgba(255, 0, 0, 0.3);
    }
}

/* Download Button */
/* Per-card download button — hidden, now in bottom dock */
.download-button {
    display: none !important;
}

.download-button:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

.download-button:active {
    transform: translate3d(0, 0, 0) scale(0.95);
}

.download-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translate3d(0, 0, 0);
}

/* Download Toast */
.download-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 16px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    
    /* Backdrop blur */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* Animation */
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    pointer-events: none;
}

.download-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.download-toast.success {
    background: rgba(34, 197, 94, 0.9);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.download-toast.error {
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Hide download button during swipe */
.swipe-card.dragging .download-button {
    opacity: 0;
    pointer-events: none;
}

/* Show download button only on active card */
.swipe-card:not(.active) .download-button {
    opacity: 0;
    pointer-events: none;
}

/* Aesthetic DNA Loading */
.dna-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dna-loading.show {
    opacity: 1;
    transform: scale(1);
}

.dna-loading-content {
    text-align: center;
    color: #fff;
    max-width: 300px;
}

.dna-loading-content h2 {
    font-size: 24px;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.dna-loading-content p {
    font-size: 16px;
    opacity: 0.7;
    margin: 0;
}

.dna-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Share Toast (for DNA sharing) */
.share-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 16px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    max-width: 320px;
    text-align: center;
    white-space: pre-line;
    
    /* Backdrop blur */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* Animation */
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    pointer-events: none;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.share-toast.success {
    background: rgba(34, 197, 94, 0.9);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.share-toast.error {
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.share-toast.info {
    background: rgba(59, 130, 246, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .blur-placeholder {
        transition: none;
    }
    
    .swipe-indicator {
        transition: opacity 0.1s;
    }
    
    .download-button,
    .download-toast {
        transition: opacity 0.1s;
    }
}

/* Aesthetic DNA Test Overlay */
.dna-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1100;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.4s ease-out;
    
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dna-overlay.visible {
    opacity: 1;
    transform: scale(1);
}

.dna-content {
    max-width: 90vw;
    max-height: 90vh;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 30px;
    color: var(--color-text);
    overflow-y: auto;
    text-align: center;
    border: 1px solid var(--color-border);
}

.dna-header {
    position: relative;
    margin-bottom: 30px;
}

.dna-header h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 10px;
    color: var(--color-accent);
}

.dna-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.dna-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.dna-type h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #A29BFE;
}

.dna-description {
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.dna-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.dna-stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #6C5CE7;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dna-traits, .dna-palette {
    margin-bottom: 25px;
}

.dna-traits h3, .dna-palette h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.trait-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.trait-tag {
    padding: 6px 12px;
    background: rgba(108, 92, 231, 0.2);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 16px;
    font-size: 0.8rem;
    color: #A29BFE;
}

.color-swatches {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dna-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    align-items: center;
}

.dna-action {
    padding: 12px 30px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-out;
    min-width: 200px;
    
    -webkit-tap-highlight-color: transparent;
}

.dna-action.primary {
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    color: white;
}

.dna-action.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.3);
}

.dna-action.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dna-action.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1200;
    transition: all 0.3s ease-out;
    
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

/* Mobile responsiveness for DNA test */
@media (max-width: 480px) {
    .dna-content {
        padding: 20px;
        max-height: 85vh;
    }
    
    .dna-header h1 {
        font-size: 1.5rem;
    }
    
    .dna-type h2 {
        font-size: 1.3rem;
    }
    
    .dna-stats {
        gap: 20px;
    }
    
    .dna-action {
        min-width: 160px;
        padding: 10px 24px;
        font-size: 14px;
    }
    
    .color-swatch {
        width: 32px;
        height: 32px;
    }
}

/* Settings Button — hide the dynamically-created one (now in dock) */
body > .settings-button {
    display: none !important;
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1050;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease-out;
    
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.settings-overlay.visible {
    opacity: 1;
    transform: scale(1);
}

.settings-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 90vw;
    width: 400px;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.settings-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.settings-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-option:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
}

.setting-label {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.setting-description {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.3;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.toggle-switch.active {
    background: #6C5CE7;
}

.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease-out;
    transform: translateX(0);
}

.toggle-switch.active .toggle-knob {
    transform: translateX(24px);
}

/* Clear Data Button */
.clear-data-button {
    padding: 10px 20px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-out;
    
    -webkit-tap-highlight-color: transparent;
}

.clear-data-button:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
}

.clear-data-button:active {
    transform: scale(0.95);
}

/* Confirmation Dialog */
.confirmation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1100;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.confirmation-dialog.visible {
    opacity: 1;
}

.confirmation-content {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 24px;
    max-width: 90vw;
    width: 320px;
    color: white;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.confirmation-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.confirmation-message {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    margin-bottom: 24px;
}

.confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirmation-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-out;
    min-width: 80px;
}

.confirmation-button.danger {
    background: #ef4444;
    color: white;
}

.confirmation-button.danger:hover {
    background: #dc2626;
}

.confirmation-button.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.confirmation-button.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .settings-content {
        padding: 24px;
        margin: 20px;
        width: auto;
    }
    
    .settings-title {
        font-size: 1.3rem;
    }
    
    .setting-label {
        font-size: 0.95rem;
    }
    
    .setting-description {
        font-size: 0.8rem;
    }
    
    .confirmation-content {
        padding: 20px;
        margin: 20px;
        width: auto;
    }
}
/* PWA Update Toast */
.update-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(59, 130, 246, 0.95);
    color: #fff;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    max-width: 280px;
    
    /* Backdrop blur */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* Animation */
    animation: slideInFromRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.update-toast button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}

.update-toast button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

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

/* Settings Toast */
.settings-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    max-width: 300px;
    text-align: center;
    
    /* Backdrop blur */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    /* Animation */
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    pointer-events: none;
}

.settings-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.settings-toast.success {
    background: rgba(34, 197, 94, 0.9);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.settings-toast.error {
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.settings-toast.info {
    background: rgba(59, 130, 246, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ===== Taste Profile Overlay ===== */
.taste-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.4s var(--ease-out);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.taste-overlay.visible {
    opacity: 1;
    transform: translateY(0);
}

.taste-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    padding-top: max(16px, env(safe-area-inset-top));
    position: sticky;
    top: 0;
    background: var(--color-bg);
    z-index: 10;
    border-bottom: 1px solid var(--color-border);
}

.taste-header-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-text);
}

.taste-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
}

.taste-close:hover {
    background: var(--color-surface-raised);
    border-color: rgba(255, 255, 255, 0.15);
}

.taste-body {
    padding: 24px 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* Taste status card */
.taste-status {
    width: 100%;
    max-width: 340px;
    padding: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.taste-status-icon {
    font-size: 40px;
    margin-bottom: 12px;
    line-height: 1;
}

.taste-status h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-text);
    margin-bottom: 8px;
}

.taste-status p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* Taste stats row */
.taste-stats {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 340px;
}

.taste-stat-card {
    flex: 1;
    padding: 16px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
}

.taste-stat-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: 4px;
}

.taste-stat-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Taste traits */
.taste-traits-section {
    width: 100%;
    max-width: 340px;
}

.taste-section-title {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.taste-trait-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.taste-trait {
    padding: 6px 14px;
    background: var(--color-accent-muted);
    border: 1px solid rgba(200, 162, 255, 0.2);
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 500;
}

/* Taste empty state */
.taste-empty {
    width: 100%;
    max-width: 340px;
    padding: 40px 24px;
    text-align: center;
}

.taste-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.taste-empty h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-text);
    margin-bottom: 8px;
}

.taste-empty p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.taste-empty-cta {
    display: inline-block;
    padding: 12px 24px;
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
}

.taste-empty-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.12);
}

/* Taste progress bar */
.taste-progress {
    width: 100%;
    max-width: 340px;
}

.taste-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--color-surface-raised);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.taste-progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    transition: width 0.6s var(--ease-out);
}

.taste-progress-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

/* Color palette in taste */
.taste-palette {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.taste-palette-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s var(--ease-spring);
}

.taste-palette-swatch:hover {
    transform: scale(1.15);
}

/* ===== DNA Reveal (celebration after 30 swipes) ===== */
.dna-reveal-hero {
    text-align: center;
    padding: 32px 20px 24px;
    animation: dnaRevealIn 0.6s var(--ease-out) both;
}

.dna-reveal-emoji {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 16px;
    animation: dnaEmojiPop 0.5s var(--ease-spring) 0.3s both;
}

.dna-reveal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-text);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.dna-reveal-tagline {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
    max-width: 300px;
    margin: 0 auto;
}

.dna-reveal-message {
    width: 100%;
    max-width: 340px;
    padding: 20px;
    background: var(--color-accent-muted);
    border: 1px solid rgba(200, 162, 255, 0.15);
    border-radius: var(--radius-md);
    text-align: center;
    animation: dnaRevealIn 0.5s var(--ease-out) 0.2s both;
}

.dna-reveal-message p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
}

.dna-reveal-message strong {
    color: var(--color-accent);
    font-weight: 600;
}

.dna-reveal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    animation: dnaRevealIn 0.5s var(--ease-out) 0.4s both;
}

.dna-reveal-cta {
    padding: 16px 24px;
    background: var(--color-text);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.dna-reveal-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.12);
}

.dna-reveal-cta:active {
    transform: scale(0.97);
}

.dna-reveal-share {
    padding: 14px 24px;
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.dna-reveal-share:hover {
    color: var(--color-text);
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--color-surface);
}

/* DNA loading — refined */
.dna-loading-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-text);
    margin: 20px 0 6px;
}

.dna-loading-sub {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin: 0;
}

@keyframes dnaRevealIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dnaEmojiPop {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
