/* ═══════════════════════════════════════════════════════
   Slate Personalizer — Frontend Styles
   ═══════════════════════════════════════════════════════ */

/* ── Container ── */
.wsp-personalizer {
    margin: 24px 0;
    padding: 0;
    max-width: 100%;
}

/* ── Heading ── */
.wsp-heading {
    background: linear-gradient(135deg, #faf7f2 0%, #f5f0e8 100%);
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.5;
    color: #4a4237;
}
.wsp-heading-icon {
    margin-right: 6px;
    font-size: 18px;
    color: #b8956a;
}

/* ── Sections ── */
.wsp-section {
    margin-bottom: 28px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 20px;
    background: #fff;
    transition: border-color 0.2s;
}
.wsp-section:hover {
    border-color: #ccc;
}
.wsp-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.wsp-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #2c2c2c;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}
.wsp-step-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}
.wsp-required {
    color: #c0392b;
    text-decoration: none;
    font-weight: 700;
    border: none;
}

/* ── Image Tabs ── */
.wsp-image-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.wsp-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.wsp-tab-btn:hover {
    border-color: #999;
    background: #f0f0f0;
}
.wsp-tab-btn.active {
    border-color: #2c2c2c;
    background: #2c2c2c;
    color: #fff;
}
.wsp-tab-btn svg {
    flex-shrink: 0;
}
.wsp-tab-content {
    display: none;
}
.wsp-tab-content.active {
    display: block;
}

/* ── Dropzone ── */
.wsp-dropzone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fdfdfd;
}
.wsp-dropzone:hover,
.wsp-dropzone.dragover {
    border-color: #888;
    background: #f8f8f8;
}
.wsp-dropzone.dragover {
    border-color: #4a90d9;
    background: #f0f6ff;
}
.wsp-dropzone-inner p {
    margin: 6px 0;
    color: #555;
}
.wsp-dropzone-inner p strong {
    color: #333;
    font-size: 15px;
}
.wsp-dropzone-sub {
    font-size: 13px;
    color: #888 !important;
}
.wsp-file-input {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ── Upload Previews ── */
.wsp-upload-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}
.wsp-upload-thumb {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.wsp-upload-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wsp-upload-thumb .wsp-upload-remove {
    position: absolute;
    top: 4px; right: 4px;
    width: 24px; height: 24px;
    background: rgba(0,0,0,0.65);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s;
    padding: 0;
}
.wsp-upload-thumb .wsp-upload-remove:hover {
    background: #c0392b;
}
.wsp-upload-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 4px;
    background: #4a90d9;
    border-radius: 0 0 8px 8px;
    transition: width 0.2s;
}

/* ── Stock Image Picker ── */
.wsp-stock-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.wsp-stock-item {
    position: relative;
    border: 3px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    aspect-ratio: 1;
}
.wsp-stock-item:hover {
    border-color: #aaa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.wsp-stock-item.selected {
    border-color: #2c2c2c;
    box-shadow: 0 0 0 2px #2c2c2c;
}
.wsp-stock-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wsp-stock-item .wsp-stock-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 11px;
    font-weight: 500;
}
.wsp-stock-item .wsp-stock-check {
    position: absolute;
    top: 6px; right: 6px;
    width: 26px; height: 26px;
    background: #2c2c2c;
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.wsp-stock-item.selected .wsp-stock-check {
    display: flex;
}

/* ── Font Picker ── */
.wsp-font-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.wsp-font-option {
    cursor: pointer;
    display: block;
}
.wsp-font-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.wsp-font-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 80px;
}
.wsp-font-option:hover .wsp-font-card {
    border-color: #aaa;
    background: #fafafa;
}
.wsp-font-option input:checked + .wsp-font-card {
    border-color: #2c2c2c;
    background: #f9f7f4;
    box-shadow: 0 0 0 2px #2c2c2c;
}
.wsp-font-preview {
    font-size: 22px;
    line-height: 1.2;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.wsp-font-sample {
    font-size: 12px;
    color: #888;
    line-height: 1.3;
}

/* ── Text Area ── */
.wsp-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    margin-bottom: 6px;
}
.wsp-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}
.wsp-textarea:focus {
    outline: none;
    border-color: #888;
}
.wsp-char-count {
    text-align: right;
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

/* ── Live Text Preview ── */
.wsp-text-preview {
    margin-top: 12px;
    padding: 16px;
    background: #1a1a1a;
    border-radius: 8px;
    text-align: center;
}
.wsp-preview-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 8px;
}
.wsp-preview-content {
    font-size: 26px;
    color: #fff;
    line-height: 1.4;
    word-break: break-word;
}

/* ── Phrase Divider ── */
.wsp-text-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #aaa;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wsp-text-divider::before,
.wsp-text-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

/* ── Phrase Chips ── */
.wsp-phrase-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wsp-phrase-option {
    cursor: pointer;
    display: inline-block;
}
.wsp-phrase-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.wsp-phrase-chip {
    display: inline-block;
    padding: 8px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 24px;
    font-size: 14px;
    color: #555;
    background: #fff;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.wsp-phrase-option:hover .wsp-phrase-chip {
    border-color: #aaa;
    background: #f8f8f8;
}
.wsp-phrase-option input:checked + .wsp-phrase-chip {
    border-color: #2c2c2c;
    background: #2c2c2c;
    color: #fff;
}
.wsp-phrase-chip-clear {
    color: #999;
    font-size: 13px;
    border-style: dashed;
}

/* ── Notes Section ── */
.wsp-section-notes {
    border-style: dashed;
    background: #fcfcfc;
}
.wsp-textarea-notes {
    border-style: dashed;
}

/* ── Validation Messages ── */
.wsp-validation-msg {
    padding: 12px 16px;
    background: #fdf0ef;
    border: 1px solid #e8c4c0;
    border-radius: 8px;
    color: #a94442;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ── Uploading state ── */
.wsp-dropzone.uploading {
    pointer-events: none;
    opacity: 0.6;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .wsp-section {
        padding: 14px;
    }
    .wsp-image-tabs {
        flex-direction: column;
    }
    .wsp-tab-btn {
        justify-content: center;
    }
    .wsp-font-picker {
        grid-template-columns: repeat(2, 1fr);
    }
    .wsp-stock-picker {
        grid-template-columns: repeat(3, 1fr);
    }
    .wsp-upload-thumb {
        width: 80px;
        height: 80px;
    }
    .wsp-preview-content {
        font-size: 20px;
    }
}
