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

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

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar - Blocos Disponíveis */
.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 600;
}

.sidebar-header p {
    font-size: 14px;
    opacity: 0.9;
}

.blocks-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.block-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: grab;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.block-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.block-item:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.block-item h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.block-item p {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.block-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Área de Montagem (Centro) */
.builder-area {
    width: 380px;
    background: #f9f9f9;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

.builder-header {
    padding: 24px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.builder-header h2 {
    font-size: 18px;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.builder-header p {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.block-count-builder {
    display: inline-block;
    padding: 6px 12px;
    background: #f0f4ff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

.block-count-builder span {
    color: #764ba2;
    font-size: 14px;
}

.drop-zone-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.drop-zone {
    min-height: 300px;
    border: 3px dashed #d0d0d0;
    border-radius: 12px;
    background: #fff;
    transition: all 0.3s ease;
    position: relative;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.drop-zone-placeholder {
    padding: 60px 20px;
    text-align: center;
    color: #999;
    pointer-events: none;
}

.drop-zone-placeholder svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.drop-zone-placeholder p {
    font-size: 16px;
    font-weight: 500;
}

.inserted-blocks {
    min-height: 100px;
    padding: 12px;
}

.inserted-block {
    position: relative;
    margin: 12px 0;
    padding: 14px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.inserted-block:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.inserted-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.inserted-block-title {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
}

.block-controls {
    display: flex;
    gap: 6px;
}

.block-control-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.block-control-btn:hover {
    background: #667eea;
    color: white;
}

.block-control-btn:nth-last-child(1):hover {
    background: #ff4757;
}

.block-control-btn svg {
    width: 16px;
    height: 16px;
}

.inserted-block-content {
    font-size: 12px;
    color: #999;
    font-style: italic;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
}

.builder-actions {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Main Content - Preview */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fafafa;
}

.toolbar {
    background: #fff;
    padding: 20px 32px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.toolbar h1 {
    font-size: 22px;
    color: #333;
    font-weight: 600;
}

.toolbar-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #fff;
    border-color: #ff4757;
    color: #ff4757;
}

/* Preview Container */
.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-header {
    display: none; /* Não usado mais */
}

.block-count {
    display: none; /* Movido para builder-header */
}

.preview-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px 20px 30px 20px;
    background: #fafafa;
}

.email-preview {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
    min-height: 400px;
    height: 4000px;

}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inserted-block {
    animation: slideIn 0.3s ease;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inserted-block {
    animation: fadeIn 0.3s ease;
}

/* Responsive */
@media (max-width: 1400px) {
    .sidebar {
        width: 260px;
    }
    .builder-area {
        width: 340px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    .builder-area {
        width: 300px;
    }
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 30vh;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .builder-area {
        width: 100%;
        max-height: 35vh;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        padding: 16px 20px;
    }
    
    .toolbar h1 {
        font-size: 18px;
    }
    
    .toolbar-actions {
        width: 100%;
    }
    
    .btn {
        flex: 1;
    }
}
