* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #2c3e50;
    font-size: 1.75rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.btn-primary, .btn-secondary, .btn-success, .btn-text {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-text {
    background: transparent;
    color: #3b82f6;
    padding: 0.5rem;
}

.btn-text:hover {
    background: #eff6ff;
}

.widget-selector {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.widget-selector h2 {
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.widget-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.widget-card:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.widget-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.widget-card h3 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.widget-card p {
    color: #6b7280;
    font-size: 0.9rem;
}

.widget-workspace {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.workspace-actions {
    display: flex;
    gap: 1rem;
}

.widget-container {
    min-height: 400px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 2rem;
}

.saved-widgets {
    background: white;
    padding: 2rem;
    border-radius: 12px;
}

.saved-widgets h2 {
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.saved-list {
    display: grid;
    gap: 1rem;
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.saved-item-info {
    flex: 1;
}

.saved-item-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.saved-item-meta {
    font-size: 0.85rem;
    color: #6b7280;
}

.saved-item-actions {
    display: flex;
    gap: 0.5rem;
}

.hidden {
    display: none !important;
}

.drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s;
}

.drop-zone.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.preview-container {
    margin-top: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.preview-header h3 {
    color: #1f2937;
}

/* Form Widget Specific Styles */
.form-question-editor {
    animation: slideIn 0.3s ease;
}

.form-question-editor input[type="text"] {
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-question-editor input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-question-editor input[type="checkbox"],
.form-question-editor input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-question-editor button:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    transition: all 0.2s;
}

.form-option-row {
    background: white;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.form-option-row:hover {
    background: #f3f4f6;
}

/* Image List Styles */
.image-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.image-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.image-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.image-item-info input {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
}

.image-item-info small {
    color: #6b7280;
    font-size: 12px;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    .widget-grid {
        grid-template-columns: 1fr;
    }

    .workspace-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
    }
}