.tool-content {
    background: #fff;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 1100px;
    margin: 0 auto;
    overflow: hidden;
}

.generator-layout {
    display: flex;
    min-height: 500px;
}

.sidebar {
    width: 320px;
    background: #f8f9fa;
    padding: 1.5rem;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-panel {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.preview-area {
    flex: 1;
    width: 100%;
    min-height: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    /* Fallback */
    transition: background-image 0.2s;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: bold;
    font-size: 0.9rem;
}

.pattern-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pattern-option {
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    background-size: cover;
}

.pattern-option.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.output-actions {
    background: #2d2d2d;
    padding: 1.5rem;
    border-radius: 8px;
    color: white;
}

.code-box-wrapper {
    position: relative;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.output-actions pre {
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
    font-size: 0.85rem;
    color: #e2e2e2;
}

.copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.primary-btn {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: #0056b3;
}

@media (max-width: 800px) {
    .generator-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
}