/**
 * Embroidery Effect - Use Case Specific Styles
 * Simple layout: Upload artwork, select template, see result
 */

/* ===== Embroidery Layout ===== */
.embroidery-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
}

.embroidery-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.embroidery-right {
    display: flex;
    flex-direction: column;
}

/* ===== Uploaded Preview ===== */
.uploaded-preview {
    display: none;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.uploaded-preview img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    padding: 16px;
}

.uploaded-preview .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--error);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    box-shadow: var(--shadow);
}

.uploaded-preview .remove-btn:hover {
    transform: scale(1.1);
}

.uploaded-preview .remove-btn svg {
    width: 14px;
    height: 14px;
}

/* ===== Template Grid ===== */
.template-section {
    flex: 1;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.template-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.template-option:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: var(--shadow);
}

.template-option.active {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.template-thumb {
    width: 100%;
    height: 80px;
    background: var(--surface-secondary);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

/* Template thumb backgrounds - placeholders */
.polo-thumb {
    background: linear-gradient(145deg, #1e3a5f 0%, #152a43 100%);
}

.cap-thumb {
    background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%);
}

.jacket-thumb {
    background: linear-gradient(145deg, #14532d 0%, #0f3d22 100%);
}

.hoodie-thumb {
    background: linear-gradient(145deg, #78716c 0%, #57534e 100%);
}

.bag-thumb {
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
}

.beanie-thumb {
    background: linear-gradient(145deg, #7f1d1d 0%, #5c1414 100%);
}

.template-option span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.template-option.active span {
    color: var(--primary);
}

/* ===== Preview Container ===== */
.preview-container {
    flex: 1;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 400px;
    box-shadow: var(--shadow);
}

.mockup-preview-large {
    flex: 1;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4/3;
    background: linear-gradient(145deg, #1e3a5f 0%, #152a43 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

/* Fabric texture overlay */
.mockup-preview-large::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
}

.embroidery-area {
    width: 180px;
    height: 130px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.embroidery-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    padding: 16px;
}

.embroidery-placeholder svg {
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.25);
}

.embroidery-placeholder span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
}

/* Embroidery preview image */
.embroidery-preview-img {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.preview-info {
    margin-top: 20px;
    text-align: center;
}

.preview-info .template-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .embroidery-content {
        grid-template-columns: 1fr;
    }

    .embroidery-right {
        order: -1;
    }

    .template-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mockup-preview-large {
        aspect-ratio: 1;
    }
}
