/* css/contribute.css - Contribute Session UI (matches Flutter dark theme) */

/* Camera-scoped variables */
#camera-modal {
    --cs-bg: #0D1117;
    --cs-bg-card: rgba(13, 15, 30, 0.87);
    --cs-cyan: #00BCD4;
    --cs-cyan-glow: rgba(0, 188, 212, 0.4);
    --cs-text: #FFFFFF;
    --cs-text-muted: rgba(255, 255, 255, 0.54);
    --cs-text-secondary: rgba(255, 255, 255, 0.70);
    --cs-border: rgba(255, 255, 255, 0.12);
    --cs-divider: rgba(255, 255, 255, 0.08);
    --cs-success: #4CAF50;
    --cs-warning: #FFC107;
    --cs-error: #F44336;
}

/* ========== STATUS PILL (top center) ========== */
.cs-status-pill {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 50;
    display: none;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs-status-text {
    color: var(--cs-text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.cs-status-ready .cs-status-text { color: var(--cs-cyan); }
.cs-status-success .cs-status-text { color: var(--cs-success); }
.cs-status-warning .cs-status-text { color: var(--cs-warning); }
.cs-status-error .cs-status-text { color: var(--cs-error); }
.cs-status-syncing .cs-status-text { color: var(--cs-text-muted); }

/* ========== STORE INFO PILL (left side) ========== */
.cs-store-info-pill {
    position: absolute;
    left: 15px;
    bottom: 22px;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--cs-border);
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 45;
    cursor: pointer;
    transition: background 0.2s;
}

.cs-store-info-pill:active {
    background: rgba(0, 188, 212, 0.2);
}

.cs-store-info-pill svg {
    width: 24px;
    height: 24px;
    fill: var(--cs-cyan);
}

/* ========== LEAVE & EARN BUTTON (top right) ========== */
.cs-leave-earn-btn {
    position: absolute;
    top: 60px;
    right: 15px;
    padding: 8px 12px;
    background: var(--cs-cyan);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    display: none;
    align-items: center;
    gap: 6px;
    z-index: 50;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.cs-leave-earn-btn:active {
    transform: scale(0.95);
}

.cs-leave-earn-btn span {
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.cs-leave-earn-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* ========== STORE PICKER OVERLAY ========== */
.cs-store-picker {
    position: absolute;
    bottom: 185px;
    left: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.87);
    border-radius: 16px;
    border: 1px solid var(--cs-border);
    z-index: 55;
    display: none;
    max-height: 50vh;
    overflow: hidden;
    animation: cs-slide-up 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cs-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.cs-store-picker-header {
    display: flex;
    align-items: center;
    padding: 14px 16px 8px;
    gap: 8px;
}

.cs-store-picker-header svg {
    width: 18px;
    height: 18px;
    fill: var(--cs-cyan);
}

.cs-store-picker-header span {
    color: white;
    font-weight: 700;
    font-size: 15px;
}

.cs-store-list {
    max-height: calc(50vh - 120px);
    overflow-y: auto;
}

.cs-store-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--cs-divider);
    cursor: pointer;
    transition: background 0.15s;
}

.cs-store-item:active {
    background: rgba(255, 255, 255, 0.05);
}

.cs-store-name {
    flex: 1;
    color: white;
    font-size: 14px;
}

.cs-store-distance {
    color: rgba(255, 255, 255, 0.38);
    font-size: 12px;
    margin-right: 8px;
}

.cs-store-chevron {
    color: rgba(255, 255, 255, 0.38);
    font-size: 20px;
}

.cs-store-empty {
    color: var(--cs-text-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

.cs-store-create-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--cs-divider);
    cursor: pointer;
}

.cs-store-create-btn:active {
    background: rgba(255, 255, 255, 0.05);
}

.cs-store-create-btn svg {
    width: 20px;
    height: 20px;
    fill: var(--cs-cyan);
}

.cs-store-create-btn span {
    color: var(--cs-cyan);
    font-weight: 600;
    font-size: 14px;
}

/* ========== CREATE STORE CONFIRM ========== */
.cs-create-confirm {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 55;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.cs-create-confirm-card {
    background: var(--cs-bg);
    border: 1px solid var(--cs-border);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 320px;
    text-align: center;
}

.cs-create-confirm-icon {
    margin-bottom: 12px;
}

.cs-create-confirm-icon svg {
    fill: var(--cs-cyan);
}

.cs-create-confirm-card h3 {
    color: white;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 10px;
}

.cs-create-confirm-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 20px;
}

.cs-create-confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cs-create-confirm-yes {
    background: var(--cs-cyan);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.cs-create-confirm-yes:active {
    opacity: 0.85;
}

.cs-create-confirm-no {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.cs-create-confirm-no:active {
    background: rgba(255, 255, 255, 0.05);
}

/* ========== SHUTTER BUTTON STATES ========== */
/* Make capture button position relative for label overlay */
.capture-button {
    position: relative;
}

/* SYNC state: blue fill + pulsing glow */
.capture-button-inner.cs-shutter-sync {
    background-color: rgba(33, 150, 243, 0.9) !important;
}

.capture-button-outer.cs-shutter-sync {
    animation: cs-sync-pulse 1.5s infinite;
}

@keyframes cs-sync-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--cs-cyan-glow); }
    50% { box-shadow: 0 0 20px 6px var(--cs-cyan-glow); }
}

/* SYNCING state: green with spinner */
.capture-button-inner.cs-shutter-syncing {
    background-color: rgba(76, 175, 80, 0.9) !important;
}

.capture-button-outer.cs-shutter-syncing {
    border-color: rgba(255, 255, 255, 0.38) !important;
}

/* CAPTURE state: white fill (standard iOS style) */
.capture-button-inner.cs-shutter-capture {
    background-color: white !important;
}

/* Shutter label overlay */
#cs-shutter-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    pointer-events: none;
    display: none;
    z-index: 5;
}

.cs-shutter-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: cs-spin 0.8s linear infinite;
}

@keyframes cs-spin {
    to { transform: rotate(360deg); }
}

/* ========== BOTTOM GRADIENT SHADOW ========== */
.cs-gradient-shadow {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    pointer-events: none;
    z-index: 9;
    display: none;
}

/* ========== BOTTOM SHEET ========== */
.cs-bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--cs-bg);
    border-radius: 20px 20px 0 0;
    z-index: 60;
    max-height: 60vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs-bottom-sheet.cs-sheet-open {
    transform: translateY(0);
}

.cs-sheet-grabber {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.24);
    border-radius: 2px;
    margin: 12px auto;
    cursor: pointer;
}

.cs-sheet-content {
    padding: 0 20px 36px;
}

/* Earn rates table */
.cs-earn-rates-table {
    background: #0D1822;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px;
    margin-bottom: 16px;
}

.cs-rate-header, .cs-rate-row {
    display: grid;
    grid-template-columns: 3fr 2fr 2fr;
    padding: 4px 0;
}

.cs-rate-header span {
    color: #607D8B;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
}

.cs-rate-header span:first-child {
    text-align: left;
}

.cs-rate-row span {
    color: var(--cs-text-secondary);
    font-size: 13px;
    text-align: center;
}

.cs-rate-row span:first-child {
    text-align: left;
    color: var(--cs-text);
}

.cs-rate-highlight span {
    color: var(--cs-cyan) !important;
}

/* Category progress */
.cs-category-list {
    max-height: 200px;
    overflow-y: auto;
}

.cs-cat-item {
    margin-bottom: 10px;
}

.cs-cat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.cs-cat-name {
    color: #B0BEC5;
    font-size: 13px;
}

.cs-cat-count {
    color: #80DEEA;
    font-size: 12px;
}

.cs-cat-bar-bg {
    height: 6px;
    background: #1A2332;
    border-radius: 3px;
    overflow: hidden;
}

.cs-cat-bar-fill {
    height: 100%;
    background: var(--cs-cyan);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ========== FRAMING GUIDE ========== */
.cs-framing-guide { margin-bottom: 16px; }

.cs-framing-label {
    color: rgba(255,255,255,0.54);
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 8px;
}

.cs-framing-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 10px;
}
.cs-framing-carousel::-webkit-scrollbar { display: none; }

.cs-framing-carousel img {
    min-width: 100%;
    height: 180px;
    object-fit: cover;
    scroll-snap-align: center;
    border-radius: 10px;
}

.cs-framing-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.cs-framing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.24);
    transition: background 0.2s;
}
.cs-framing-dot.active { background: var(--cs-cyan); }

.cs-framing-tip {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    text-align: center;
    margin: 6px 0 0;
}

/* ========== LEAVE CARD ========== */
.cs-leave-card {
    position: absolute;
    bottom: 250px;
    left: 16px;
    right: 16px;
    background: var(--cs-bg-card);
    border: 1.5px solid var(--cs-cyan);
    border-radius: 14px;
    padding: 14px;
    z-index: 55;
    display: none;
}

.cs-leave-store-name {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.cs-leave-store-name svg {
    width: 16px;
    height: 16px;
    fill: var(--cs-cyan);
}

.cs-leave-store-name span {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.cs-leave-upload-btn {
    width: 100%;
    padding: 12px;
    background: var(--cs-cyan);
    border-radius: 10px;
    border: none;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.cs-leave-upload-btn:active {
    opacity: 0.8;
}

.cs-leave-skip-btn {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
}

.cs-leave-skip-btn:active {
    background: rgba(255, 255, 255, 0.12);
}

.cs-leave-done {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 10px;
}

/* ========== GHOST IMAGE OVERLAY (SIFT verification) ========== */
.cs-ghost-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 15;
    pointer-events: none;
    opacity: 0.3;
}

.cs-ghost-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Pulsing dashed border — "align here" cue */
.cs-ghost-overlay::after {
    content: '';
    position: absolute;
    top: 20px; left: 20px; right: 20px; bottom: 20px;
    border: 2px dashed rgba(0, 229, 255, 0.7);
    border-radius: 12px;
    animation: cs-march-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cs-march-pulse {
    0%, 100% { border-color: rgba(0, 229, 255, 0.3); }
    50% { border-color: rgba(0, 229, 255, 0.8); }
}

/* ========== ENTRANCE PHOTO CYCLER ========== */
.cs-entrance-cycler {
    position: absolute;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 50;
}

.cs-cycler-btn {
    width: 44px; height: 44px;
    background: rgba(0, 0, 0, 0.5);
    border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

.cs-cycler-btn svg { width: 28px; height: 28px; fill: white; }

.cs-cycler-info {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 25px;
    padding: 8px 20px;
}

.cs-cycler-info #cs-entrance-name { color: white; font-weight: 700; font-size: 14px; }
.cs-entrance-counter { color: #00E5FF; font-weight: 700; font-size: 10px; letter-spacing: 1.2px; }

/* ========== SKIP VERIFICATION BUTTON ========== */
.cs-skip-verify-btn {
    position: absolute;
    bottom: 155px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    cursor: pointer;
    z-index: 50;
    display: none;
    align-items: center;
}

.cs-skip-verify-btn span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* ========== ENTRANCE PHOTO PROMPT ========== */
.cs-entrance-prompt {
    position: absolute;
    left: 0; right: 0; bottom: 100px; /* Sit above capture button, not over viewfinder */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 55;
    pointer-events: none;
}

.cs-entrance-prompt-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 24px 28px;
    max-width: 280px;
    text-align: center;
    pointer-events: auto;
}

.cs-entrance-prompt-card svg {
    opacity: 0.8;
    margin-bottom: 4px;
}

.cs-entrance-prompt-title {
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.cs-entrance-prompt-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    line-height: 1.4;
}

.cs-entrance-prompt-skip {
    margin-top: 4px;
    padding: 6px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    cursor: pointer;
}

/* ========== BOTTOM SHEET BACKDROP ========== */
.cs-sheet-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: transparent;
    z-index: 59;
    display: none;
}

/* ========== PHOTO GALLERY ========== */
.cs-gallery-thumb {
    position: relative;
    width: 48px; height: 48px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.24);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.cs-gallery-thumb svg { width: 24px; height: 24px; fill: rgba(255, 255, 255, 0.5); }
.cs-gallery-thumb.cs-gallery-has-image svg { display: none; }

.cs-gallery-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #4CAF50;
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-sizing: border-box;
    line-height: 1;
}

.cs-gallery-view {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: black;
    z-index: 70;
    display: none;
    flex-direction: column;
}

.cs-gallery-back {
    position: absolute;
    top: 60px; left: 20px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    z-index: 5;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

.cs-gallery-back svg { width: 24px; height: 24px; fill: white; }

.cs-gallery-hint {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    z-index: 5;
    white-space: nowrap;
}

.cs-gallery-container {
    flex: 1;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cs-gallery-container::-webkit-scrollbar { display: none; }

.cs-gallery-container img {
    min-width: 100%;
    height: 100%;
    object-fit: contain;
    scroll-snap-align: center;
}

.cs-gallery-delete {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(244, 67, 54, 0.8);
    border: 2px solid white;
    position: absolute;
    bottom: 40px;
    left: 50%; transform: translateX(-50%);
    cursor: pointer;
    z-index: 5;
    display: flex; align-items: center; justify-content: center;
}

.cs-gallery-delete svg { width: 28px; height: 28px; fill: white; }

/* ========== PHOTO COUNTER PILL ========== */
#pf-photo-counter {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: opacity 0.2s;
}

/* ========== STORAGE FULL MESSAGE ========== */
#pf-storage-full-msg {
    animation: cs-slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== UPLOAD RESUME BANNER ========== */
#pf-upload-resume-banner {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    animation: pf-banner-slide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pf-banner-slide {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ========== ONBOARDING & PREF MODALS ========== */
#pf-earn-onboarding,
#pf-upload-pref-modal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    animation: pf-modal-fade 0.25s ease;
}

@keyframes pf-modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
