:root {
    --bg-color: #f7f9fc;
    --primary-color: #0ab39c;
    /* Green accent */
    --text-primary: #1a1c21;
    --text-secondary: #878a99;
    --white: #ffffff;
    --border: #e0e0e0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    /* Center content vertically for mobile feel, optional but nice */
    min-height: 100vh;
}

.upload-container {
    max-width: 600px;
    /* Constrained for mobile/tablet feel on desktop */
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.shop-header {
    text-align: center;
    margin-bottom: 32px;
}

.shop-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.shop-header .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Skeleton Loader for Shop Verification */
.skeleton-loader {
    display: inline-block;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent;
    user-select: none;
}

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

    100% {
        background-position: -200% 0;
    }
}

/* Upload Zone */
.upload-zone {
    width: 100%;
    margin-bottom: 10px;
}

/* Do NOT use display:none — Android Chrome falls back to Camera/Photos sheet.
   Use visually-hidden instead so the browser engine treats it as a real element. */
.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 2px dashed #cfd8dc;
    border-radius: 8px;
    padding: 15px 15px;
    min-height: 100px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: none;
}

.upload-label:hover {
    border-color: var(--primary-color);
    background-color: #fbfffe;
}

.upload-label:active {
    transform: scale(0.99);
}

/* Drag & Drop Visual Feedback */
.upload-zone.drag-over .upload-label {
    border-color: var(--primary-color);
    background-color: #e6f7f5;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(10, 179, 156, 0.2);
}

.drop-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.select-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 32px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(10, 179, 156, 0.2);
    transition: background-color 0.2s;
    text-align: center;
}

.select-btn:hover {
    background-color: #099c88;
}

.subtitle-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.limit-text,
.types-text {
    font-size: 10px;
    color: #909399;
}

.types-text {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.8;
}

/* Optional lock icon for security text */
.types-text::before {
    content: "";
    /* Simple lock emoji or similar could work, but using pure CSS/unicode for lock */
    content: "\1F512";
    font-size: 12px;
    opacity: 0.7;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 10px;
}

.file-item {
    background: var(--white);
    border-radius: 12px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.file-icon {
    width: 30px;
    height: 30px;
    background: #f0f2f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.file-info {
    flex: 1;
    min-width: 0;
    /* logic for text ellipsis */
}

.file-name {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.file-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
}

.remove-btn {
    background-color: #fee2e2;
    color: #ef4444;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.remove-btn:hover {
    background-color: #ef4444;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.page-count-badge {
    background: #e6f7f4;
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Action Area (Toggle & Send) */
.action-area {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.option-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-label {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

/* Professional Segmented Control (Pill Shape) */
.toggle-switch {
    display: flex;
    background: #f1f5f9;
    /* Light slate gray */
    padding: 4px;
    border-radius: 50px;
    /* Full pill shape */
    position: relative;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

.toggle-switch input {
    display: none;
}

.toggle-switch label {
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2;
    cursor: pointer;
    color: #64748b;
    /* Muted text */
    transition: all 0.2s ease;
    border-radius: 50px;
}

.toggle-switch input:checked+label {
    color: var(--text-primary);
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

.send-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #089c88 100%);
    color: var(--white);
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(10, 179, 156, 0.3);
    letter-spacing: 0.3px;
}

.send-btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(10, 179, 156, 0.4);
}

.send-btn:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(10, 179, 156, 0.2);
}

.send-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    transform: none !important;
    box-shadow: 0 2px 4px rgba(10, 179, 156, 0.15) !important;
}

/* Success Card */
.success-card {
    text-align: center;
    background: var(--white);
    padding: 30px 24px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    margin-top: 15px;
    animation: fadeIn 0.5s ease-out;
    border: 1px solid #f0f0f0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-icon {
    color: var(--primary-color);
    margin-bottom: 24px;
    background: #e6f7f4;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
}

.success-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.order-id {
    font-size: 120px;
    /* Huge bold text as requested */
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1;
    letter-spacing: -3px;
    font-family: 'Inter', sans-serif;
}

.token-prefix {
    font-size: 40px;
    vertical-align: 15%;
    opacity: 0.8;
    margin-right: 6px;
}

.success-note {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Meme Image Styling */
.meme-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.success-meme {
    max-width: 100%;
    width: 280px;
    /* Optimal size for mobile/desktop */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}


.order-summary {
    font-size: 14px;
    color: #828e9e;
    background: #f8fafc;
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 20px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 90%;
    width: 400px;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.3s ease-out;
    border-left: 4px solid var(--primary-color);
}

.toast.toast-warning {
    border-left-color: #f59e0b;
}

.toast.toast-error {
    border-left-color: #ef4444;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.toast-content small {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 2px;
}

.toast.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* =============================================
   Custom File Picker Bottom Sheet
   ============================================= */

/* Click area on the upload zone — no longer a <label>, so cursor + keyboard */
#open-picker-btn {
    cursor: pointer;
    user-select: none;
}

#open-picker-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: 8px;
}

/* Full-screen dark overlay */
.picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    /* Backdrop blur for modern feel */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.picker-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* The card — NO transform, transform creates a GPU compositing layer
   that breaks Android Chrome file picker (shows Camera/Photos instead of Files) */
.picker-sheet {
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 12px 0 24px;
    width: 100%;
    max-width: 600px;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
}

.picker-overlay.open .picker-sheet {
    opacity: 1;
}

/* Drag handle */
.picker-handle {
    width: 40px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 0 auto 16px;
}

/* Title */
.picker-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 20px 12px;
}

/* Each selectable option */
.picker-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.picker-option:active {
    background: #f0faf8;
}

/* Ripple-like touch feedback */
.picker-option::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.picker-option:active::after {
    opacity: 0.06;
}

/* Emoji / icon */
.picker-icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Text block */
.picker-option-text {
    flex: 1;
    min-width: 0;
}

.picker-option-text strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.picker-option-text small {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Chevron */
.picker-arrow {
    color: #cbd5e1;
    flex-shrink: 0;
}

/* Divider between options */
.picker-option+.picker-option {
    border-top: 1px solid #f1f5f9;
}

/* Cancel button */
.picker-cancel {
    display: block;
    width: calc(100% - 40px);
    margin: 16px 20px 0;
    padding: 14px;
    background: #f1f5f9;
    color: var(--text-primary);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.picker-cancel:active {
    background: #e2e8f0;
}