/* ==========================================================================
   Mockup Submit Form — AE Digitizing/Mockup Request Form
   Used by: ae-dashboard.html (Request Mockup Ruth tab)
   Prefix: msf- (Mockup Submit Form)
   Theme colors via CSS variables. Defaults to purple; AE overrides with maroon.
   ========================================================================== */

:root {
    --art-theme: #6B46C1;
    --art-theme-dark: #553C9A;
    --art-theme-light: #8B5CF6;
    --art-theme-bg: #f8f5ff;
    --art-theme-bg-hover: #f3f0ff;
    --art-theme-bg-selected: #f3eaff;
    --art-theme-rgba-15: rgba(107,70,193,0.15);
    --art-theme-rgba-10: rgba(107,70,193,0.1);
}

.msf-container {
    max-width: 700px;
    margin: 0 auto;
}

/* ── Ruth Info Banner ───────────────────────────────── */
.msf-ruth-banner {
    display: flex;
    gap: 20px;
    background: var(--art-theme-bg);
    border: 2px solid var(--art-theme);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    align-items: center;
}

.msf-ruth-photo {
    flex-shrink: 0;
    text-align: center;
    width: 140px;
}

.msf-ruth-photo img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--art-theme);
    box-shadow: 0 4px 12px var(--art-theme-rgba-15);
}

.msf-ruth-photo h4 {
    margin: 8px 0 2px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.msf-ruth-photo p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.msf-ruth-info {
    flex: 1;
}

.msf-ruth-info h3 {
    margin: 0 0 8px 0;
    color: var(--art-theme);
    font-size: 16px;
    font-weight: 700;
}

.msf-ruth-info p {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.msf-mandatory-bar {
    margin-top: 12px;
    background: var(--art-theme);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

/* ── Form Card ──────────────────────────────────────── */
.msf-form-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.msf-form-header {
    background: linear-gradient(135deg, var(--art-theme), var(--art-theme-dark));
    color: white;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
}

.msf-form-body {
    padding: 24px;
}

/* ── Request Type Toggle ───────────────────────────── */
.msf-toggle-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.msf-toggle-row {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--art-theme);
}

.msf-toggle-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: white;
    color: var(--art-theme);
    transition: all 0.2s ease;
}

.msf-toggle-btn:hover {
    background: var(--art-theme-bg);
}

.msf-toggle-btn.active {
    background: var(--art-theme);
    color: white;
}

.msf-toggle-helper {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    text-align: center;
    font-style: italic;
}

/* ── Form Fields ────────────────────────────────────── */
.msf-field {
    margin-bottom: 20px;
}

.msf-field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.msf-field-label .msf-required {
    color: #dc2626;
    margin-left: 2px;
}

.msf-field-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.msf-input,
.msf-select,
.msf-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.msf-input:focus,
.msf-select:focus,
.msf-textarea:focus {
    outline: none;
    border-color: var(--art-theme);
    box-shadow: 0 0 0 3px var(--art-theme-rgba-10);
}

.msf-input.msf-error,
.msf-select.msf-error,
.msf-textarea.msf-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

.msf-error-msg {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

/* ── Checkbox Group (multi-select application types) ──── */
.msf-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.msf-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.msf-checkbox-label:hover {
    border-color: var(--art-theme);
    background: var(--art-theme-bg);
}
.msf-checkbox-label:has(input:checked) {
    border-color: var(--art-theme);
    background: var(--art-theme-bg-selected);
    color: var(--art-theme-dark);
    font-weight: 500;
}
.msf-checkbox-label input[type="checkbox"] {
    accent-color: var(--art-theme);
}
.msf-checkbox-group.msf-error {
    border: 1px solid #dc2626;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

.msf-textarea {
    min-height: 100px;
    resize: vertical;
}

.msf-input[readonly] {
    background: #f3f4f6;
    color: #666;
    cursor: not-allowed;
}

/* ── Two-Column Row ─────────────────────────────────── */
.msf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Design Autocomplete ────────────────────────────── */
.msf-autocomplete-wrap {
    position: relative;
}

.msf-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

.msf-autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.msf-autocomplete-item:hover {
    background: var(--art-theme-bg-hover);
}

.msf-autocomplete-item:last-child {
    border-bottom: none;
}

.msf-autocomplete-design-num {
    font-weight: 600;
    color: var(--art-theme);
}

.msf-autocomplete-company {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.msf-autocomplete-loading {
    padding: 16px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* ── Thread Color Chips ─────────────────────────────── */
.msf-thread-picker {
    position: relative;
}

.msf-thread-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 0;
}

.msf-thread-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--art-theme-bg-hover);
    border: 1px solid #d4c8f0;
    border-radius: 20px;
    font-size: 13px;
    color: var(--art-theme);
    font-weight: 500;
}

.msf-thread-chip-remove {
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #999;
    margin-left: 2px;
    line-height: 1;
}

.msf-thread-chip-remove:hover {
    color: #dc2626;
}

.msf-thread-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

.msf-thread-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.msf-thread-option:hover {
    background: var(--art-theme-bg-hover);
}

.msf-thread-option.selected {
    background: #ede9fe;
    font-weight: 600;
}

.msf-thread-number {
    color: #888;
    font-size: 12px;
}

/* ── File Upload ────────────────────────────────────── */
.msf-file-drop {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    color: #888;
    font-size: 14px;
}

.msf-file-drop:hover {
    border-color: var(--art-theme);
    background: var(--art-theme-bg);
    color: var(--art-theme);
}

.msf-file-drop-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.msf-file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--art-theme-bg-hover);
    border-radius: 6px;
    margin-top: 8px;
}

.msf-file-preview-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msf-file-remove {
    cursor: pointer;
    color: #dc2626;
    font-size: 18px;
    font-weight: bold;
    padding: 0 4px;
}

/* ── Submit Button ──────────────────────────────────── */
.msf-submit-row {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.msf-submit-btn {
    padding: 12px 32px;
    background: var(--art-theme);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.msf-submit-btn:hover {
    background: var(--art-theme-dark);
}

.msf-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.msf-submit-status {
    font-size: 14px;
    color: #888;
}

/* ── Success State ──────────────────────────────────── */
.msf-success {
    text-align: center;
    padding: 40px 20px;
}

.msf-success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.msf-success h3 {
    font-size: 20px;
    color: #059669;
    margin-bottom: 8px;
}

.msf-success p {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.msf-success-link {
    display: inline-block;
    padding: 10px 24px;
    background: var(--art-theme);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.msf-success-link:hover {
    background: var(--art-theme-dark);
}

.msf-success-another {
    display: inline-block;
    margin-left: 12px;
    padding: 10px 24px;
    background: white;
    color: var(--art-theme);
    border: 1px solid var(--art-theme);
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.msf-success-another:hover {
    background: var(--art-theme-bg-hover);
}

/* ── Toast ──────────────────────────────────────────── */
.msf-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10001;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.msf-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.msf-toast--success { background: #059669; }
.msf-toast--error { background: #dc2626; }
.msf-toast--info { background: var(--art-theme); }

/* ── Garment Style/Color Rows ──────────────────────── */
.msf-garment-row {
    display: grid;
    grid-template-columns: 1fr 1fr 40px 32px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.msf-garment-style-wrap {
    position: relative;
}
.msf-garment-style-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 50;
}
.msf-style-option {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}
.msf-style-option:hover {
    background: var(--art-theme-bg, #f0ebff);
    color: var(--art-theme-dark, #5b3aad);
}
.msf-style-loading {
    padding: 10px 12px;
    color: #888;
    font-size: 13px;
    text-align: center;
}
.msf-garment-swatch {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}
.msf-garment-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.msf-garment-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.msf-garment-remove:hover {
    background: #fca5a5;
}
.msf-add-garment-btn {
    border: 1px dashed #d1d5db;
    background: transparent;
    color: var(--art-theme, #6B46C1);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    margin-top: 4px;
}
.msf-add-garment-btn:hover {
    border-color: var(--art-theme, #6B46C1);
    background: var(--art-theme-bg, #f0ebff);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
    .msf-ruth-banner { flex-direction: column; text-align: center; }
    .msf-row { grid-template-columns: 1fr; }
    .msf-submit-row { flex-direction: column; }
    .msf-garment-row { grid-template-columns: 1fr; }
    .msf-garment-swatch { width: 32px; height: 32px; }
}
