/**
 * Pattern Creator - Use Case Specific Styles
 * Simplified pattern creation with mockup selection and workspace
 */

/* ===== Pattern Layout ===== */
.pattern-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    min-height: 500px;
}

/* ===== Pattern Sidebar ===== */
.pattern-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.section-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Mockup Selector ===== */
.mockup-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mockup-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

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

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

.mockup-option img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.mockup-option span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

/* ===== URL Input ===== */
.url-input-group {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.url-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.url-input::placeholder {
    color: var(--text-muted);
}

/* ===== Artwork Preview ===== */
.artwork-preview {
    margin-top: 8px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.artwork-preview img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    padding: 8px;
}

/* ===== Scale Control ===== */
.scale-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.scale-control input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--surface-secondary);
    appearance: none;
    cursor: pointer;
}

.scale-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform 0.15s ease;
    box-shadow: var(--shadow);
}

.scale-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.scale-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    min-width: 45px;
    text-align: right;
}

/* ===== Pattern Workspace ===== */
.pattern-workspace {
    display: flex;
    flex-direction: column;
}

.workspace {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 500px;
    box-shadow: var(--shadow);
}

.workspace img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.workspace-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-muted);
}

.workspace-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.5;
    color: var(--primary-lighter);
}

.workspace-placeholder span {
    font-size: 14px;
}

/* ===== Loading & Error States ===== */
.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px;
    color: var(--text-muted);
    font-size: 14px;
}

.loading-state svg,
.error-state svg {
    width: 24px;
    height: 24px;
}

.error-state svg {
    color: var(--error);
}

/* Spin animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

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

    .pattern-workspace {
        order: -1;
    }

    .workspace {
        min-height: 300px;
    }

    .mockup-selector {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .mockup-option {
        flex: 1;
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .mockup-option {
        flex: 1 1 100%;
    }
}
