/* Shared styles for test pages (CM-159) */

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; max-width: 900px; margin: 0 auto; padding: 20px; background: #f5f5f5; }
h1 { margin-bottom: 20px; }
h2 { margin-bottom: 12px; }

/* Back link */
.back-link { display: inline-block; margin-bottom: 12px; font-size: 13px; color: #2563eb; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Section cards */
.section { background: white; border-radius: 8px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Form elements */
label { display: block; font-weight: 600; margin-bottom: 4px; }
textarea, input, select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; margin-bottom: 12px; }
textarea { height: 80px; resize: vertical; }
input[type="file"] { padding: 6px; }
input[type="checkbox"] { width: auto; margin: 0; }

/* Buttons */
button { padding: 10px 20px; background: #2563eb; color: white; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; margin-right: 8px; margin-bottom: 8px; }
button:disabled { background: #94a3b8; cursor: not-allowed; }
button:hover:not(:disabled) { background: #1d4ed8; }
button.secondary { background: #059669; }
button.secondary:hover:not(:disabled) { background: #047857; }
button.danger { background: #dc2626; }
button.danger:hover:not(:disabled) { background: #b91c1c; }
button.small { padding: 4px 10px; font-size: 12px; margin: 4px 2px 0; }

/* Progress bar */
.progress { margin-top: 12px; }
.progress-bar { height: 24px; background: #e5e7eb; border-radius: 12px; overflow: hidden; }
.progress-fill { height: 100%; background: #2563eb; transition: width 0.3s; border-radius: 12px; }
.progress-text { text-align: center; margin-top: 4px; font-size: 13px; color: #64748b; }

/* Work items grid */
.work-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.work-item { border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px; text-align: center; min-height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.work-item.completed { border-color: #22c55e; }
.work-item.failed { border-color: #ef4444; background: #fef2f2; }
.work-item.generating, .work-item.processing, .work-item.uploading { border-color: #eab308; }
.work-item img { max-width: 100%; border-radius: 4px; margin-top: 4px; }
.work-item .status { font-size: 12px; color: #64748b; }
.work-item .error { font-size: 11px; color: #ef4444; }
.work-item .work-item-checkbox { margin-bottom: 4px; }

/* Debug info */
.debug-info { font-size: 12px; color: #64748b; background: #f8fafc; padding: 8px; border-radius: 4px; margin-top: 8px; }

/* Log panel */
.log { font-size: 12px; color: #334155; background: #f1f5f9; padding: 8px; border-radius: 4px; margin-top: 8px; max-height: 200px; overflow-y: auto; white-space: pre-wrap; font-family: monospace; }

/* Mockup section */
.mockup-section { margin-top: 12px; padding: 12px; background: #faf5ff; border-radius: 6px; border: 1px solid #e9d5ff; }
.mockup-section h3 { margin-bottom: 8px; font-size: 14px; }
.mockup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.mockup-grid img { width: 100%; border-radius: 4px; }
.mockup-grid .mockup-item { text-align: center; }
.mockup-label { font-size: 12px; color: #64748b; margin-top: 4px; }
.mockup-loading { font-size: 13px; color: #7c3aed; }
.mockup-error { font-size: 13px; color: #ef4444; }

/* Upload status (pet portrait) */
.upload-status { font-size: 13px; color: #64748b; margin-bottom: 12px; }
.upload-status.success { color: #16a34a; }
.upload-status.error { color: #ef4444; }
.preview-img { max-width: 200px; max-height: 200px; border-radius: 8px; margin-bottom: 12px; border: 1px solid #e5e7eb; }

/* Upload progress bar */
.upload-progress { margin-bottom: 12px; }
.upload-progress-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.upload-progress-fill { height: 100%; background: #7c3aed; transition: width 0.2s; border-radius: 4px; }
.upload-progress-text { font-size: 12px; color: #7c3aed; margin-top: 2px; }

/* Fantasy league-specific */
.league-info { font-size: 14px; color: #334155; margin-bottom: 12px; padding: 10px; background: #f0fdf4; border-radius: 6px; border: 1px solid #bbf7d0; }
.order-summary { padding: 12px; background: #eff6ff; border-radius: 6px; border: 1px solid #bfdbfe; margin-top: 12px; }

/* Retry bar */
.retry-bar { margin-top: 12px; padding: 10px; background: #fef2f2; border-radius: 6px; border: 1px solid #fecaca; display: flex; align-items: center; gap: 12px; }
.retry-bar span { font-size: 13px; color: #dc2626; }

/* Quantity selector (CM-121) */
.quantity-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.quantity-row label { margin: 0; white-space: nowrap; }
.quantity-stepper { display: inline-flex; align-items: center; border: 1px solid #ccc; border-radius: 6px; overflow: hidden; }
.quantity-stepper button { width: 36px; height: 36px; padding: 0; margin: 0; border: none; border-radius: 0; background: #f1f5f9; color: #334155; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.quantity-stepper button:hover:not(:disabled) { background: #e2e8f0; }
.quantity-stepper button:disabled { color: #cbd5e1; cursor: not-allowed; }
.quantity-stepper .qty-value { width: 40px; text-align: center; font-size: 16px; font-weight: 600; border-left: 1px solid #ccc; border-right: 1px solid #ccc; line-height: 36px; }

/* Price breakdown (CM-121) */
.price-breakdown { font-size: 14px; color: #334155; margin-bottom: 12px; line-height: 1.6; }
.price-breakdown .price-total { font-weight: 700; font-size: 16px; border-top: 1px solid #e5e7eb; padding-top: 4px; margin-top: 4px; }

/* Order section (CM-121) */
.order-section { margin-top: 12px; padding: 16px; background: #eff6ff; border-radius: 8px; border: 1px solid #bfdbfe; }

/* Per-item quantity stepper in work item grid (CM-152) */
.work-item-qty { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.work-item-qty .qty-btn { width: 28px; height: 28px; padding: 0; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.work-item-qty .qty-value { min-width: 24px; text-align: center; font-weight: 600; font-size: 14px; }
